Perl Can't Find Script in Path

Posted by bobinyec on 2011-12-03 04:16

From the command line, I'm entering "perl fred.pl" where fred.pl is located in the path. It is not found. What I'm forced to do is to enter "perl c:\scripts\fred.pl" explicitly. How can I set up perl to work with the path? I'm using Windows XP.

Thanks,
John Bobinyec

grahams
ActiveState Staff
Thu, 2012-03-15 11:34

Windows is already set up so that Perl works with the PATH. You can tell this is the case because you don't need to type
C:\Perl\bin\perl.exe C:\scripts\fred.pl

Windows does not allow Perl scripts to work the same way as cmd/batch scripts, but there are number of coding tricks you can apply:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=796&...