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

Venerable monks,

Do forgive me for what seems a trivial issue but I am having problems upgrading my installation of perl from 5.8.8 to 5.10.0 on my Ubuntu 7.10 system. I have followed the standard installation procedure as follows:

% sh Configure -de % make % make test % sudo make install

Now this seemed to work fine (admittedly after several attempts) so I went on to test the new installation. I tried the following:

% which perl /usr/local/bin/perl % perl -v This is perl, v5.10.0 built for i686-linux Copyright 1987-2007, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 so +urce kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access + to the Internet, point your browser at http://www.perl.org/, the Perl Hom +e Page. % perl -e 'use feature qw(:5.10); say q(Hello World!);' Hello World!

As you can see, that lot works as expected. However when I tried the following:

% sudo perl -MCPAN -e 'shell' Perl lib version (v5.8.8) doesn't match executable version (v5.10.0) a +t /usr/lib/perl/5.8/Config.pm line 46. Compilation failed in require at /usr/local/share/perl/5.8.8/CPAN.pm l +ine 14. BEGIN failed--compilation aborted at /usr/local/share/perl/5.8.8/CPAN. +pm line 14. Compilation failed in require. BEGIN failed--compilation aborted. % perldoc perl Perl lib version (v5.8.8) doesn't match executable version (v5.10.0) a +t /usr/lib/perl/5.8/Config.pm line 46. Compilation failed in require at /usr/share/perl/5.8/Pod/Perldoc.pm li +ne 7. BEGIN failed--compilation aborted at /usr/share/perl/5.8/Pod/Perldoc.p +m line 7. Compilation failed in require at /usr/local/bin/perldoc line 9. BEGIN failed--compilation aborted at /usr/local/bin/perldoc line 9.

For some reason it is still checking the 5.8.8 version of Config.pm =(

Is there something obvious I am missing? Is this the wrong place to be asking this question? Any help would be much appreciated.

Thank you.


Smoothie, smoothie, hundre prosent naturlig!

Replies are listed 'Best First'.
Re: Problems upgrading perl 5.8.8 to 5.10.0 on Ubuntu Desktop 7.10
by chromatic (Archbishop) on Jan 17, 2008 at 02:52 UTC

    If you didn't specify another prefix for Perl 5.10.x modules when you compiled the new version, you're probably re-using the same module installation paths between Perl 5.8.x and 5.10.x, in which case you now have two broken Perl installations. Pure-perl modules should be fine, but XS components are different between the two major versions.

    You need to reinstall the system Perl and then reconfigure and recompile 5.10, giving it a different installation path.

Re: Problems upgrading perl 5.8.8 to 5.10.0 on Ubuntu Desktop 7.10
by hipowls (Curate) on Jan 17, 2008 at 01:56 UTC

    What are the values of the environment variables PERL5LIB and PERLLIB? They tell perl where to search for modules. Does running cpan without using sudo give the same error? If not then check your /etc/sudoers file.

Re: Problems upgrading perl 5.8.8 to 5.10.0 on Ubuntu Desktop 7.10
by j1n3l0 (Friar) on Jan 17, 2008 at 10:15 UTC
    PERLLIB did not have any value and PERL5LIB came back with 5.8.8 values (no 5.10.0).

    And yes, running CPAN without sudo gave the same result.

    I did not specify another prefix for Perl 5.10.x modules as the installation instructions said the defaults were usually okay.

    Plus when I did (in an earlier attempt) install perl 5.10.0 in a different directory:

    % sh Configure -Dprefix='/opt/perl5.10'

    I had pretty much the same issue.

    I will have to get back to this in the evening when I finish from work. Thanks for now though.


    Smoothie, smoothie, hundre prosent naturlig!

      PERLLIB did not have any value and PERL5LIB came back with 5.8.8 values (no 5.10.0).

      There's your answer, you need to set it to 5.10.0 or just unset it. You can do that in the /etc/profile or in your .profile (name varies depending on the shell you use).

Re: Problems upgrading perl 5.8.8 to 5.10.0 on Ubuntu Desktop 7.10
by j1n3l0 (Friar) on Jan 17, 2008 at 22:36 UTC
    Okay, so I have come to a solution (of sorts). I have unset the PERL5LIB in my ~/.bashrc and it appears to work. Now when I do the above I get the results you would expect.

    Furthermore, I decided to check what @INC and $PERL5LIB are now as follows:

    % perl -MData::Dumper -e 'print Dumper { INC_ARRAY => [ @INC ], PERL5L +IB => $ENV{PERL5LIB} }' $VAR1 = { 'INC_ARRAY' => [ '/usr/local/lib/perl5/5.10.0/i686-linux', '/usr/local/lib/perl5/5.10.0', '/usr/local/lib/perl5/site_perl/5.10.0/i686 +-linux', '/usr/local/lib/perl5/site_perl/5.10.0', '.' ], 'PERL5LIB' => undef };

    Now though it seems that the modules I installed in 5.8.8 (e.g Smart::Comments) are no longer working but that is not really a problem. I just have to update CPAN and I can reinstall the modules I still need.

    Thank you all for your input =)


    Smoothie, smoothie, hundre prosent naturlig!