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

We have a server (in active production use) that's running perl 5.005_03. we're having to do some things that require a much newer version of perl, but we also have several hundreds of mission-critical scripts scattered all over the system that may be dependant on 5.005, so I suggested the idea of installing another version of perl in parallel.

our current (old) version of perl is installed in /usr/lib/perl5, and we'd like to not disturb anything in that installation, and in fact having /usr/bin/perl still point to the old one. i'm thinking we install perl 5.8 to /usr/lib/perl58 and put the perl binary as /usr/bin/perl58. then use the perl58 in the shebang of anything new.

are there any potential pitfalls or conflicts that i havent taken into account, or anything else at all to keep in mind? because we pretty much have on shot at this...if we screw up the 5.005 install in any way, our entire system will likely go down.

Replies are listed 'Best First'.
Re: install another perl without disturbing the older install?
by gellyfish (Monsignor) on Jul 27, 2006 at 21:04 UTC

    I would suggest installing the new perl with a completely different PREFIX - conventionally people will use /usr/local/ so your perl binary is at /usr/local/bin/perl and your libraries are in /usr/local/lib/.

    /J\

      should i still rename the perl binary? because if our PATH is:

      /usr/kerberos/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin

      then anything such as a cron job or a command for 'perl' would bring up the wrong (newer) version, right?

Re: install another perl without disturbing the older install?
by johngg (Canon) on Jul 27, 2006 at 22:27 UTC
    I would agree with gellyfish about installing the new version well away from the existing one; /usr/lib/perl5 and /usr/lib/perl58 are too similar for safety. You'll have to choose something other than /usr/local because of your $PATH. I think there is a question during configuration about "Would you like to put a copy of the new binary in /usr/bin?" to which the default answer is yes. Obviously, don't accept the default answer there.

    A different approach would be to find another server, possibly a cheap box off eBay, install your new perl there and test your scripts. I did notice your "scattered all over the system" so I realise that this may not be easy to do.

    Best of luck,

    JohnGG

      i think the configure script defaults to 'no' on putting a new binary in /usr/bin if it finds one already exists, so the defaults might work just fine.

      and i've seen perl installed within /opt before, which should work since its not in the OP's $PATH

      __________
      Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
      - Terry Pratchett

        You are right. Now I'm back in the office I have looked at the log of a build of perl 5.8.4 on a Solaris box. The default to "Do you want to install perl as /usr/bin/perl?" is indeed no.

        One less thing for the AnonyMonk to worry about.

        Cheers,

        JohnGG