Friday, September 25, 2009

CPAN error: Recursive dependency detected

Yesterday I updated my RedHat Enterprise system with the latest security fixes, after which my primary Perl scripts stopped working.

I went into the CPAN shell and started with 'install Bundle::CPAN', which yielded the following errors:

Recursive dependency detected:
=> A/AN/ANDYA/Test-Harness-3.17.tar.gz
=> File::Spec
=> S/SM/SMUELLER/PathTools-3.30.tar.gz
=> Scalar::Util
=> G/GB/GBARR/Scalar-List-Utils-1.21.tar.gz
=> Test::More
=> M/MS/MSCHWERN/Test-Simple-0.94.tar.gz
=> Test::Harness.
Cannot continue.

I found several other references to this problem, none of which provided a solution for me.

I traced the problem back to List::Util. One low-level module required version 1.21 (which was installed), but gave an error that version 1.19 was installed. I traced the problem to the fact that my Perl installation had two separate directories where List::Util was stored:


The first directory contained version 1.21, the second directory contained version 1.19.

I solved the problem by removing the multi-thread directories for List and for Scalar:


After this, I was able to install Bundle::CPAN.


  1. Hi,
    i am having a very similar problem... how would i go about "tracing it" as you did?
    install Bundle::CPAN
    Running install for module 'Test::Harness'
    Running make for A/AN/ANDYA/Test-Harness-3.17.tar.gz
    Prepending /root/.cpan/build/Data-Dumper-2.125/blib/arch /root/.cpan/build/Data-Dumper-2.125/blib/lib to PERL5LIB for 'get'
    Has already been unwrapped into directory /root/.cpan/build/Test-Harness-3.17-vekN5B
    Prepending /root/.cpan/build/Data-Dumper-2.125/blib/arch /root/.cpan/build/Data-Dumper-2.125/blib/lib to PERL5LIB for 'make'
    Has already been made
    Prepending /root/.cpan/build/Data-Dumper-2.125/blib/arch /root/.cpan/build/Data-Dumper-2.125/blib/lib to PERL5LIB for 'test'
    Running make test
    Can't use string ("YES") as a HASH ref while "strict refs" in use at /usr/lib/perl5/5.8.8/CPAN/ line 2944.
    thanks in advance
    the noob...

  2. I traced it through a combination of Google searches (to help know what to look for) followed by attempting to install those four modules one at a time, then trying the dependent failures, and so on down the line.