How to Get Perl to Automatically Look in Specific Directories for Scripts?

Posted by wingedknight on 2016-09-15 18:18

I have ActiveState Perl installed on a Windows machine.

Now, suppose I have scripts, including one called "", in this directory:


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\

...just fine.

But the following...:


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?

wingedknight | Sat, 2016-09-17 17:13

Just in case anyone else runs across this problem and is looking for a solution, I learned elsewhere that there is indeed a way to do this:

(1) add the directory to the Windows PATH variable

(2) then run Perl with the -S switch