in reply to Why does the CPAN module upgrade to perl 5.6?

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