in reply to Re: How do I test a script that doesn't have a .pl extension
in thread How do I test a script that doesn't have a .pl extension

Update: stepped through the execution and found why it fails.
In require_ok
# Try to determine if we've been given a module name or file. # Module names must be barewords, files not. $module = qq['$module'] unless _is_module_name($module);
the problem is in _is_module_name
foo is being treated as a module because of this
$module =~ s/\b::\b//g; return $module =~ /^[a-zA-Z]\w*$/ ? 1 : 0;
with "foo.pl" it returns 0
with "foo" it returns 1
changing it to
# $module =~ s/\b::\b//g; return $module =~ /^[a-zA-Z]\w*$/ ? 1 : 0 if $module =~ s/\b::\b//g;
resolves the problem and works for these tested scenarios
require_ok("foo"); require_ok('foo'); require_ok("foo.pl"); require_ok('foo.pl'); require_ok("Net::FTP"); require_ok('Net::FTP');