rpike has asked for the wisdom of the Perl Monks concerning the following question:

If I go into DOS and type in perl -v I get Version 5.6.1. On the same machine, if I print out the version number form a CGI (Perl) script I get 5.0. How can I install the latest version of Perl and make any other versions dormant? I would like to grab at least version 5.10 (the simplier the instructions the better so as I don't miss or misunderstand anything). Any help would be greatly appreciated. Thanks.

Replies are listed 'Best First'.
Re: Version(s) of Perl
by davorg (Chancellor) on Jul 08, 2009 at 13:38 UTC
    On the same machine, if I print out the version number form a CGI (Perl) script I get 5.0.

    I'd like to see the code that you're using to get that result. It seems very unlikely to me that any Windows machine is running Perl 5.0.

    For lots of useful information about running Perl on a Windows machine, see the Win32 Perl Wiki.


    See the Copyright notice on my home node.

    Perl training courses

Re: Version(s) of Perl
by moritz (Cardinal) on Jul 08, 2009 at 13:13 UTC
    You install a newest perl just like you would install any perl version, then update the PATH environment variable to point to the new perl, and configure your web server (and all other programs that store perl paths somewhere) to use the new perl, too.
Re: Version(s) of Perl
by cdarke (Prior) on Jul 08, 2009 at 15:01 UTC
    I hope you are not using DOS, that was 16-bit. Presumably you mean cmd.exe. First uninstall existing versions of Perl, using the control panel. Now install your new version.

    The PATH environment variable will probably be updated by the installation, you can check this with the path command from cmd.exe (make sure you start cmd.exe after the installation). You might also wish to check the file association with assoc .pl and ftype Perl.

    You have to be careful if you have more than one Perl installation on the same machine because these three items may all be different in the registry.
Re: Version(s) of Perl
by rpike (Scribe) on Jul 08, 2009 at 13:19 UTC
    Do I keep the old paths in there that point to the current version(s) or remove them? Where else would you set up these paths? I thought the only place needed would be in the environment variables. Here's what I'm faced with. If I go into add/remove programs there is an activestate version 5.6 and 5.8. If I print from the script it says version 5.0. There seems to be a bunch of versions floating around on there. Thank you for the reply.
Re: Version(s) of Perl
by rpike (Scribe) on Jul 08, 2009 at 13:47 UTC
    When I print out the value in $] I get 5.006001. Not sure how old the windows machine is but it is at least 4 years old.
      5.6.1 is the short way of saying 5.006001 (or 5.006001 is the long way of saying 5.6.1 depending on how you look at it)
      $ perl -MConfig -le'print for $], $Config{version}' 5.008008 5.8.8
        You mean to tell me that's how the version 5.6 is displayed? Lol. Great. So if I decide to install 5.10+ and I want to have that as the active version I can go through the steps of installing activestate's version and simply add an entry in the environment path variable as well as the script that handles .pl scripts in IIS? Then I can just remove whatever entries are there for 5.6 in the path and the reference in IIS? I'm guessing this will require an unfortunate reboot? Thanks for the info.