in reply to CPAN Error

I ran into same issue, it seems that in order to use some packages that are not pure perl, you need to rebuild them in order to use them with new perl version. Yum normally rebuilds them, but if you installed them manually, the yum can not detect them and keep the old version. I resolved the issue this way :

mv /usr/lib/perl5 /usr/lib/perl5-backup mv /usr/lib64/perl5 /usr/lib64/perl5-backup yum reinstall perl

Replies are listed 'Best First'.
Re^2: CPAN Error
by mds (Novice) on Jan 06, 2015 at 21:09 UTC
    How I solved this problem, YMMV.
    Updated perl perl-5.8.8-42.el5 to perl-5.8.8-43.el5

    Got the following error when I tried to run cpan :

    Attempt to free unreferenced scalar: SV 0x87bf8e4, Perl interpreter: 0 +x869f008 at /usr/lib/perl5/5.8.8/ExtUtils/Liblist.pm line 6. Segmentation fault
    Other scripts produced this error:
    Attempt to free unreferenced scalar: SV 0xe07c990, Perl interpreter: 0 +xe055010 at /usr/lib/perl5/5.8.8/FindBin.pm line 101. Segmentation fault
    Downgraded perl to perl-5.8.8-42.el5 and still got the same problem

    The problem is that we installed something via CPAN that is a different version then what redhat perl uses.
    I duplicated this problem by creating a CentOS image ( CentOS release 5.11 (Final) )
    This installed perl-5.8.8-42.el5. I updated everything except perl.
    I then installed cpan bundle ( cpan> install Bundle::CPAN )
    At this point everything still works.
    yum update -> installed the perl-5.8.8-43.el5
    This broke cpan and other modules.

    It looks like this is the main culprit:
    Cwd was downgraded when perl was upgraded.

    Module id = Cwd CPAN_USERID SMUELLER (Steffen Mueller smueller@cpan.org) CPAN_VERSION 3.47 CPAN_FILE S/SM/SMUELLER/PathTools-3.47.tar.gz MANPAGE Cwd - get pathname of current working directory INST_FILE /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Cwd.pm INST_VERSION 3.12 <code> The fix: <br>Download PathTools-3.47 from CPAN <br>[http://search.cpan.org/~smueller/PathTools-3.47/] <p> edit MakeFile.PL <br>In Makefile.PL in PathTools-3.47 <br>Before the following line add “use File::Spec” (It must be before +the line "use ExtUtils::MakeMaker;" ) <br>Like so: <code> use File::Spec; use ExtUtils::MakeMaker; # make # make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/crossplatform.........ok 1/71Can't use an undefined value as an ARRA +Y reference at /usr/lib/perl5/5.8.8/Test/Harness.pm line 373. make: *** [test_dynamic] Error 255
    I went ahead and ran make install anyways.
    # make install

    This fixed the cpan problem with the "unreferenced scalar".
    From there I ran "install Test::Harness" which resulted in this error:

    Can't call method "reftype" on unblessed reference at /usr/lib64/perl5 +/5.8.8/x86_64-linux-thread-multi/Safe.pm line 370.
    According to this reference the fix was to change reftype to ref.
    http://www.schnallich.net/index.php/Cpan

    I changed the line on 370 in Safe.pm to

    my $reftype = $item && ref $item
    Downloaded Scalar-List-Utils-1.41
    Installed it even though Test::Harness failed as above

    This allowed me to do a cpan> install Test::Harness

    After that I also updated the following through CPAN:
    Test::Simple
    ExtUtils::MakeMaker

    This seemed to fix all the problems I was seeing.
    The real solution is to get off of redhat 5 and go to 6 or 7.
    Then roll my own perl and never touch the system installed perl except through yum updates as previously stated by marto.

      We had the same problem after a perl update from redhat. You solution worked fine. Thanx
      Thanks man!!! You saved my day!
      Thank you for this! I got slightly different results for the Makefile step, but also installed it anyway. Install Test::Harness didn't complain at all, nor did install Test::Simple and ExtUtils::MakeMaker. I'd seen other reference to the 'upgrade' hosing things. Your info was the only real *solution* I've seen.

      i have the same issue but when i try to

      #make

      i got the error:

      [root@SV-MONITORING-VIP PathTools-3.47]# make make: *** No targets specified and no makefile found. Stop. [root@SV-MONITORING-VIP PathTools-3.47]#

      How can i fix this?

        run perl Makefile.PL the first step , that creates a Makefile, which make can read when you run make as a second step
Re^2: CPAN Error
by Anonymous Monk on Apr 14, 2015 at 13:07 UTC
    Hi, we had the same issue solved by reinstalling perl and all the modules with yum. Thanks!
Re^2: CPAN Error
by Anonymous Monk on Oct 22, 2015 at 22:49 UTC
    This one worked for me. Thanks for the easy fix.