in reply to DBD::MySQL

A very common way of managing versions with linux is to use symbolic links to choose the current installed version. So for example you could keep however many old versions you want in /usr/src and do:
ln -s /usr/src/perl-5.8.7 /usr/local/lib/perl5

to select v5.8.7 as the active one

Update: In response to reply, I am suggesting keeping installations separate in their own directory and using /usr/local/lib/perl5 merely to link to the particular version to be activated. I am not saying you have to keep more versions, but some people like to keep old versions for old code which then has to specifically access the old version under /usr/src/perl-whatever-version-number. Further, although this works with any posix, the technique has become particularly popular with distributed linux applications.

One world, one people

Replies are listed 'Best First'.
Re^2: Upgrading Perl
by jhourcle (Prior) on Jul 06, 2005 at 14:25 UTC

    If you're going to symlink directories (which should work for any posix systems, not just linux), I'd suggest that you make a perl5.8 directory, and not name it 'perl5', as any perl 5.8.x modules with compiled components are not backwards compatable with 5.6.x and earlier. (and the 5.6.x modules with compiled components aren't forwards compatable with 5.8.x)

    Update: ah...if it's the binary that's in the location (I saw 'lib', and thought it was the module include path), then I'd definately suggest being careful with messing with the original installed by the OS. See Re^2: Solaris, Perl 5.8 and use 5.005 and Maintaining an Enterprise Perl Distribution for more details.

      I think you miss my point, so I'll update the post to clarify what I am suggesting.

      One world, one people

Re^2: Upgrading Perl
by dam1an (Initiate) on Jul 06, 2005 at 15:20 UTC
    The problem is that linux (RedHat9.0) think that my perl version is 5.8.7 and he is write.
    root@vega [~]# perl -v This is perl, v5.8.7 built for i686-linux Copyright 1987-2005, Larry Wall

    But, WebHostManager (Cpanel) still saying me, that I'm using perl 5.8.1. And the costomers of that server still using perl-5.8.1 I suppose.

    I think, that after upgrading perl in write directory Cpanel will understand that my perl version is 5.8.7. Or not? May be I should find some spetial modules for the Cpanel to make it understand which version of perl am I using?

    If I'll make now this sym link what does it gives to me? Linux already knows that my perl had upgreted

    One more quetion about /usr/local/lib/perl5/site_perl. After upgrading there was only one empty directory /usr/local/lib/perl5/site_perl/5.8.7/i686-linux. Is this normal? I suppose that I shouldn't copying all the files there from /usr/local/lib/perl5/5.8.7 ? Schould I remove them now from i686-linux/ and from 5.8.7/ ?
    This helps U to understand me:
    root@vega [/usr/local/lib/perl5/site_perl/5.8.7]# ls ./ Config/ FreezeThaw.pm LWP/ Module/ T +ext/ ../ DBIx/ Hook/ lwpcook.pod Net/ T +ime/ Algorithm/ Devel/ HTML/ LWP.pm Number/ T +ree/ Apache/ Error.pm HTTP/ lwptut.pod prefork.pm U +RI/ auto/ Exception/ i686-linux/ Mail/ Regexp/ U +RI.pm Bundle/ ExtUtils/ IO/ MIME/ set-version.pl* W +WW/ Cache/ File/ Locale/ MLDBM/ Sub/ X +ML/ Class/ Font/ Log/ MLDBM.pm Test/
    root@vega [/usr/local/lib/perl5/site_perl/5.8.7/i686-linux]# ls ./ Attribute/ Compress/ DBI.pm Mysql/ Roadmap.pod + Want.pm ../ auto/ DBD/ Digest/ Mysql.pm* RT_SiteConfig.pm* + Win32/ Apache/ Bundle/ DBI/ HTML/ Params/ Term/ + XML/

    I think that I'll better reinstall perl. I have all chnses now to delete something important. So I decided to remove all the files from /usr/local/lib/perl5/ and reinstall perl again. Stop me plz. if I wrong.
    -- wbr damian
      When you type #perl -V, you are executing the perl binary that the shell finds in your path. Different users have different paths depending on how they log in. This might be causing the strange behavior you are seeing.

      The typical locations for the perl executable are /usr/bin and /usr/local/bin. You need to determine what the system is using and what your users are using and either install the proper perl binary in that system directory or symlink from /usr/bin/perl or /usr/local/bin/perl to the perl binary you want them to use.

      If you want to keep both versions of perl on the system, install the new perl wherever you want (follow the suggestions above). Once you verify that it is working, just change the symlink /usr/bin/perl (or /usr/local/bin/perl) to point to the new perl binary. If something breaks, you can just switch the symlink back to the old version.

      If you have a perl in several places, as it appears you do, it will save you some headaches to point them all at one actual binary. Otherwise, you'll need to maintain multiple versions of perl on your system and that can be painful.

      Perhaps I should have asked why you need to go to 5.8.7 of perl? Red Hat 9 was frozen some time ago and its perl version froze with it at 5.8.0-88.3. At least that is the latest .rpm for redhat 9 that I could find, and I always operate under the principle of using rpm to install on red hat 9 if it is at all possible, because it manages the installation process for you in a tried and tested manner.

      The symlink idea was specifically so you could stay with 5.8.1 for the applications that might need it while creating additional versions for other uses, but so far you haven't explained why you need to upgrade above 5.8.1., which is probably the key to how to proceed.

      One world, one people