raja.b4u has asked for the wisdom of the Perl Monks concerning the following question:

Hi ,
I am using Perl 5.6.1 and I have installed many perl modules .I am pla +ning to upgrade it to 5.8 . I have a questions What abt the perl modules after upgrading perl to 5.8 ? Still I can us +e wihout doing any changes?
Thanks Suriya

Replies are listed 'Best First'.
Re: upgrade from 5.6.1 to 5.8
by grinder (Bishop) on Oct 16, 2007 at 14:50 UTC

    Most of the pure-Perl modules are likely to work (that is, those without XS (binary) components). Perl code is nearly always perfectly forward-compatible.

    On the other hand, any modules that contain XS extensions will need to be reinstalled. This is because the binary interface is the same across the entire version 5.6 version (5.6.0 to 5.6.2) different for 5.8 (5.8.0 to 5.8.8), and will change again in 5.10.

    Such modules are installed in different directories (specifically in a .../mach directory). You can find out how many such directories there are with the following one-liner:

    perl -le 'print for grep {m(/mach$)} @INC'

    All of the modules found there will need to be audited to see if you are using them. Those that are will need to be recompiled and installed. Slightly more brute force is to list all the *.pm files found therein:

    find `perl -le 'print for grep {m(/mach$)} @INC'` -name '*.pm'

    The results aren't as bad as you might think. For instance, the Encode distribution contains 22 different modules that will be installed under /mach.

    • another intruder with the mooring in the heart of the Perl

Re: upgrade from 5.6.1 to 5.8
by tokpela (Chaplain) on Oct 16, 2007 at 18:53 UTC
    Jan at ActiveState responded to a post last year on the Win32 Perl list about how to get a list of your PPM installed modules and how to restore them after upgrading.

    My experience was that this did not work very well or that there were different modules already installed.

    But, if you at least have a list - you can install your previous modules pretty easily with the Visual Package Manager that comes with the 5.8.8 version.

    Subject: Upgrading Perl

    If all your modules have been installed with PPM, then you should use the ppmprofile script to save and restore these settings.

    *Before* you upgrade, install ppm-profile and save your module information:

    ppm install ppm-profile ppmprofile save c:\myppm.xml

    *After* you have installed a new ActivePerl you can restore all modules with

    ppm install ppm-profile ppmprofile restore c:\myppm.xml

    If you added additional repositories to your PPM setup, then you probably need to set them up again before running the restore to make sure ppm can locate all the modules again.

    Note that this procedure may restore a later version of a module if it has been updated in the repository since you originally installed it. It is also possible that you may not be able to re-install a module because it may no longer be available.

    I would strongly recommend to make a backup of your installation before uninstalling anything.

Re: upgrade from 5.6.1 to 5.8
by GSF (Acolyte) on Oct 16, 2007 at 16:02 UTC
    Perhaps this illustrates my inexperience but why not just try it? Installing a new version of Perl shouldn't be all taht bad, modules included, should it?
      It would make your installation unstable as you have modules "installed" which will perhaps not run or --worse-- run with subtle errors, but you will only know at the most unconvenient time, i.e. when you run them.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James