ali.muzaffar has asked for the wisdom of the Perl Monks concerning the following question:

Hello wise-ones!
This is a multipart question, recently I upgraded one of my Linux servers from Perl 5.6.1 to Perl 5.8.8. The upgrade was sort of a side effect of trying to use CPAN to install SpamAssassin. The server is in pretty bad condition if you ask me but everything seem to be working fine.

Now I have to upgrade a second Linux server and I read somewhere that you should not use CPAN to upgrade CPAN, my requirement are as follows:

1) Upgrade Perl
2) Install SpamAssassin
3) Install OpenSSL

My questions are:
a) Will upgrading perl also provide me with a newer version of CPAN?
b) What is the best way to upgrade to a newer version of Perl? Download a tar-ball and install it or use CPAN?

My server is a Red-Hat Linux 7.2.

Help will be really appricaited as the upgrade is scheduled for this weekend and I dont think it is a good idea to repeat what I did last time.

Thanks in advance

  • Comment on Upgrading Perl on Linux From 5.6.1 to 5.8.x

Replies are listed 'Best First'.
Re: Upgrading Perl on Linux From 5.6.1 to 5.8.x
by Fletch (Bishop) on Dec 21, 2006 at 20:19 UTC

    Your Perl version is the least of your problems. RH 7.2 was end of life'd around three years ago. Upgrade to a more recent OS and you'll more than likely get a more recent Perl to boot.

    And as to your questions: Yes, but there's a newer version of CPAN.pm than ships with 5.8.8 I believe. And I personally tend to keep my own "application" version of Perl compiled separately from source independent of the OS' copy. That also ensures that updates to the OS are less likely to muck about with the "production" version of Perl.

      I concur with fletch, it is best not to mess with the vendor supplied system perl. I learnt this to my cost many moons ago on a DG/UX system, when I cleverly upgraded the system perl and broke a lot of the system startup scripts.

      Compile perl-5.8.8 from source and choose an install prefix of /usr/local, or some such. Good luck.

      So this is exactly what CPAN did on the other server, it made a seperate installation of perl from the servers. It's installations were in /usr/local/bin rather than /usr/bin and I suppose SpamAssassin picked up on this.

      What do you recommend then? using CPAN or downloading Perl's tar-ball and installing that? (I think in effect they do one in the same thing? Any one sure?)
        And I personally tend to keep my own "application" version of Perl compiled separately from source ...

        This means grabbing the source to Perl and compiling it by hand. That allows me to run Perl's configure and tweak where it installs things and what not by hand; if CPAN.pm does this you're going to get the defaults.