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

On my test server I run Perl 5.8.8 and it's where code is tested for a client that runs 5.8.7. It looks like the new code is breaking due to the Perl version.

How can I install Perl version 5.8.7?

I saw 'perl-5.8.7' on CPAN but when I ran cpan> install perl-5.8.7 it wasn't found.

Replies are listed 'Best First'.
Re: Install Perl 5.8.7
by tilly (Archbishop) on Mar 28, 2009 at 16:54 UTC
    You need to compile and install this by hand. Luckily that is easier than you might think. I will assume a Unix system of some sort, and assume that you are not in a mod_perl environment.

    You need to download it, tar -xvzf perl-5.8.7.tar.gz it, then cd into the directory that was created and run ./Configure (the defaults will be OK on everything except where to install it, you want it installed to a local directory), then make, make test and finally make install.

    I would personally advise doing this as an unprivileged user so you don't accidentally overwrite any system libraries that might exist.

    That should install it to whatever directory you specified. This installation is completely independent of your existing Perl. So the next thing you need to do is /path/to/new/version/bin/perl -MCPAN -e shell and go about installing all of your CPAN dependencies. Then run your application against this version of Perl.

    If modifying your application to run against the new location of Perl is too much work, as a hack you can (as root) move your existing /usr/bin/perl then ln /path/to/new/version/bin/perl /usr/bin/perl, test your application, then remove your symlink and copy the old version of Perl back when you're done.

    If you are on a non-Unix like OS (eg Windows), then you may not have all of the tools for the above to work. If so then you'll need to manually locate a copy of an older version of Perl for your platform and follow its instructions. Likewise if you're using mod_perl then you'll need to compile Apache with mod_perl with an older version of Perl.

      the defaults will be OK

      I'm thinking that it would be better to use the same configure args as were used to build 5.8.7 on the client, just in case the args are part of the problem. (Running perl -V tells us what those args are.)

      I certainly wouldn't assume that matching up the perl versions is going to fix this problem. It may, eg, be that the problem on the 5.8.7 client arises from vendor interference with the perl source - not from the perl version being used. It would be fairly unusual to find code that works on 5.8.8, but not 5.8.7.

      Can the op show us the code that is working on one but not the other ? (I don't mean the code in its entirety, just the specific piece of code that's breaking.)

      Cheers,
      Rob
        I agree that the version of Perl is likely not the problem. Among the more likely causes is a configuration issue or a CPAN module version.

        But when someone is trying to debug an issue, they need to eliminate one factor at a time. And the experience of getting their application up and running from scratch against a new Perl may focus attention on what else can be broken.

        Besides, perl 5.8.7 was the request, so that is what I tried to help them get.

Re: Install Perl 5.8.7
by Bloodnok (Vicar) on Mar 28, 2009 at 15:11 UTC
    Is updating your code to 5.8.8 not an option - it would probably be easier in the long run.

    A user level that continues to overstate my experience :-))
      Is updating your code to 5.8.8 not an option

      As I read it, the code already does run on 5.8.8, but not on 5.8.7 which is installed at the client site. To debug this, the OP wants to have 5.8.7.

      The client runs on a hosting provider that uses 5.8.7, so upgrading isn't an option. The code has to work on 5.8.7.