This has happened a couple of times to me, but I can't pinpoint the reason. I would suggest making sure that "perl" runs the version of Perl you want, and that you don't have environment variables (like PERLLIB or PERL5LIB) that point to places with 5.6 modules). Also, make sure that you are not sharing CPAN.pm configuration information between different versions of Perl. This could happen if you have used the 5.6 version of CPAN.pm (which may have updated stuff in your ~/.cpan directory) and then try to use the 5.005 version of CPAN.pm with the same configuration directory.

I use the following (very crude) script (which I call "cpan") that automatically switches ~/.cpan directories depending on the version of Perl you are using (I used this more often when I was in the process of switching to 5.6, so I still used 5.005 stuff often). I have two directories called .cpan-5.005 and .cpan-5.6.0 in my home directory, and links called .cpan-5.00502 and .cpan-5.006 (which is what the $] variable returns under my two installed versions of perl) that point to them. Then the cpan script creates a link called .cpan that points to the corresponding directory, before actually executing the CPAN module.

eval 'exec perl -x $0 ${1+"$@"}' # -*-perl-*- if 0; #!perl -w # # A version of the cpan command that changes the ~/.cpan link to the # appropriate directory depending on which version of perl we are # running. # Diego Zamboni, June 6, 2000 # $Id$ use strict; eval "use Coy"; my $BASE=$ENV{HOME}; my $LINK="$BASE/.cpan"; # Only proceed if $LINK does not exist or it is a symlink if (-e $LINK && ! -l $LINK) { die "$LINK is not a symlink. Cannot proceed\n"; } if (-e $LINK) { unlink($LINK) or die "Error removing $LINK: $!\n"; } # Check if the directory corresponding to our version of perl exists. my $NEWNAME="$BASE/.cpan-$]"; unless (-l $NEWNAME || -d $NEWNAME) { die "$NEWNAME does not exist. Cannot proceed\n"; } symlink($NEWNAME, $LINK) or die "Error linking $NEWNAME to $LINK: $!\n +"; use CPAN; shell;

--ZZamboni


In reply to Re: Why does the CPAN module upgrade to perl 5.6? by ZZamboni
in thread Why does the CPAN module upgrade to perl 5.6? by ncw

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.