Subject: | cgi_application fails oddly on relative paths |
If you pass a relative path to the cgi_application() method, the -f and -x tests pass, but the system() call dies because '.' is not in $PATH. For example:
use WWW::Mechanize::CGI;
my $mech = WWW::Mechanize::CGI->new();
$mech->cgi_application('index.cgi');
$mech->get('http://localhost');
Fails with:
Can't exec "index.cgi": No such file or directory at /Users/chris/perl/lib/perl5/site_perl/WWW/Mechanize/CGI.pm line 42.
If I change 'index.cgi' to './index.cgi' then it works. I propose that the code be changed to use File::Spec->rel2abs, or simply document that the path should be absolute.
-- Chris