fixes for switching files in the debugger (from Ilya Zakharevich)
[p5sagit/p5-mst-13.2.git] / lib / CPAN.pm
index 3f3b980..2f22b77 100644 (file)
@@ -575,7 +575,7 @@ Please make sure the directory exists and is writable.
     }
     my $fh;
     unless ($fh = FileHandle->new(">$lockfile")) {
-       if ($! =~ /Permission/) {
+       if ($! =~ /Permission/ || $!{EACCES}) {
            my $incc = $INC{'CPAN/Config.pm'};
            my $myincc = MM->catfile($ENV{HOME},'.cpan','CPAN','MyConfig.pm');
            $CPAN::Frontend->myprint(qq{
@@ -3325,7 +3325,8 @@ sub perl {
     $perl ||= $candidate if MM->maybe_command($candidate);
     unless ($perl) {
        my ($component,$perl_name);
-      DIST_PERLNAME: foreach $perl_name ($^X, 'perl', 'perl5', "perl$]") {
+      DIST_PERLNAME:
+       foreach $perl_name ($^X, 'perl', 'perl5', "perl$Config::Config{version}") {
            PATH_COMPONENT: foreach $component (MM->path(),
                                                $Config::Config{'binexp'}) {
                  next unless defined($component) && $component;