Reputation: 1781
I have multiple versions of Perl on my Windows pc.
Here's the version I want to use when I type perl program.pl
... C:\Perl64\bin
Do I use #!
? Thanks!
Upvotes: 0
Views: 91
Reputation: 57640
The shebang is used by Unix kernels to invoke the correct interpreter. As Windows is not unixoid, the shebang is generally useless (however, perl itself will parse the shebang for flags like -w
or -T
).
In contrast, the PATH
variable is common accross all modern platforms. It specifies all locations where executable files may reside. The first match is used, i.e. you can override a default by prepending a specific location.
On Windows, the dirs are seperated by ;
, whereas Unix uses :
.
On the cmd.exe
shell, you can modify the path like
set PATH=C:\Perl64\bin;$PATH
if I am not mistaken (have nothing to test it at hand). It can also be modified under the advanced system settings. Look for “Environment Variables”.
Upvotes: 2