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.


In reply to Re^2: CPAN Error by mds
in thread CPAN Error by narendere

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.