I have ActiveState Perl installed on a Windows machine.
Now, suppose I have scripts, including one called "SomeScript.pl"
, in this directory:
"C:\Example\Foo\Bar\"
How do I configure Perl to automatically look in that directory for scripts when it is passed a script path?
For example, from the command line, I can run...:
perl C:\Example\Foo\Bar\SomeScript.pl
...just fine.
But the following...:
perl SomeScript.pl
fails because Perl doesn't know to look in the "C:\Example\Foo\Bar\"
directory. How do I configure Perl to automatically look in some specific directory for scripts when passed a script name from the command line?
This is possible in at least some Windows Perls (I'm using Strawberry 5.24).
Add the desired path to your Windows PATH. Control Panel > System > Advanced system settings > Environment variables
Run perl with the -S switch.
perl -S program.plx
All the usual headaches of managing PATH apply (e.g. the first file with that name gets run).