The easiest way to find out which Perl is being used is to ask Perl:
perl -e "print $^X"
This will tell you which Perl the OS finds first. You can also check $^X from within your Perl scripts and restart your script under a different Perl, but that is somewhat fragile.
| [reply] [d/l] |
| [reply] |
The Perl executable that is executed by default will be determined by your system path (type path at the command prompt to see what it is). The path is searched in order to find executables etc. that are not specifically identified.
If you need to change the version of Perl used then you (or the administrator) will need to change the path environment variable.
perl.exe is also associated with the .pl file extension. You will want to verify that this association points to the correct version of perl. Save a perl script with the code mentioned previously (print $^X) and run it using the perl executable perl test.pl and by just entering the name of the file.
Since you mention environment variables - there are a number that can be associated with Perl. Type 'set' to view the environment. Variables that start with perl may influence the behaviour of perl on your machine.
Look at perlrun for more details. | [reply] [d/l] [select] |
I had this problem with ActiveState Perl when I actually did install Perl in D:\Perl, and then later in C:\Perl. Their installer apparently doesn't clean up the registry when you uninstall. The upshot, if I remember correctly, was that it sometimes thought it was installed on C:, and sometimes on D:. Or, rather, the executable knew where it was, but the configuration was screwed up and sometimes modules or the PDK got installed in the wrong place if I wasn't paying attention.
If you want to fix the problem permanently, first uninstall Perl and any add-on programs such as the PDK, then physically remove all Perl directories you can find. Then use regedit to track down and remove all references to ActiveState in the registry. After that, things should be normal.
To see the path, type "path" in a command shell. To alter it, right-click on My Computer, then Environment Variables. Locate PATH in the lower window and edit it. Be careful with your semi-colons or you can mess up your configuration. | [reply] |
| [reply] |