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

Hi,

In a cargo-cult programming moment several years ago I decided it was a good idea to install stuff from CPAN to an NFS share int the following way:

perl -MCPAN -Mlocal::lib=/cm/shared/apps/perl5 -e 'CPAN::install(Acme::Bleach)'

The system Perl is 5.10. However, after fiddling around with 5.20 installed via RedHat's Software Collections, I seem to have borked some of the modules on the NFS share and am getting errors like:

Can't load '/cm/shared/apps/perl5/lib/perl5/x86_64-linux-thread-multi/ +auto/PadWalker/PadWalker.so' for module PadWalker: libperl.so.rh-perl +520-5.20: cannot open shared object file: No such file or directory a +t /usr/lib64/perl5/DynaLoader.pm line 200. at /cm/shared/apps/perl5/lib/perl5/x86_64-linux-thread-multi/Devel/Ca +ller.pm line 5.

My assumption is that I need to force a reinstall of the affected modules on the NFS share. How would I do this with some variant of the method used to install the modules or some other way?

Thanks,

loris

Replies are listed 'Best First'.
Re: Force reinstall on NFS via CPAN::install (or other method)?
by marto (Cardinal) on Dec 21, 2017 at 11:54 UTC

    Binary compatibility is an issue between versions. I'd advise against trying to support multiple versions of perl on one directory of modules. This will make life difficult. Either install perl manually in a directory other than your system perl, and just install your modules as normal, or use a tool like perlbrew if you want to manage multiple versions of perl on the same system. Also reinstall all modules on new perl, cpan with -a.

      I do realise that my original idea was a bad one. I had assumed that Perl sorts out the version- and architecture specific bits of modules into the various separate subdirectories which seem to exist. Obviously not. However, my question is how to reinstall just those modules for 5.10 on the NFS share?

        cpan -f -i Module::Name

        or with cpanm:

        cpanm --reinstall Module::Name Other::Module

        While specifying your local::lib config.

        > I had assumed that Perl sorts out the version- and architecture specific bits of modules ... Obviously not.

        Obviously, as you told it where to install them. Normally, custom built perl stores the libraries into its own site_perl directory and everything works.

        ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,