From 98a6f11e5caa62333286d697f0f5df32e778e17a Mon Sep 17 00:00:00 2001 From: "oracle@pcr8.pcr.com" Date: Mon, 19 Jul 1999 14:39:13 -0400 Subject: Use Errno more extensively so that error messages are more portable (another way would be to muck around with LC_MESSAGES). Problem reported in To: perl5-porters@perl.org Subject: [ID 19990719.003] LC_MESSAGES breaks h2xs autoloaded constants on AIX 4.1.4 Message-Id: <9907192239.AA44990@pcr8.pcr.com> p4raw-id: //depot/cfgperl@3716 --- lib/AutoLoader.pm | 3 ++- lib/CPAN.pm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index 488030aa85..1ca3b14520 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -219,13 +219,14 @@ lines: use AutoLoader; use Carp; + use Errno; sub AUTOLOAD { my $sub = $AUTOLOAD; (my $constname = $sub) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { - if ($! =~ /Invalid/) { + if ($!{EINVAL} || $! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $sub; goto &AutoLoader::AUTOLOAD; } diff --git a/lib/CPAN.pm b/lib/CPAN.pm index 3f3b980c11..401660ef44 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -19,6 +19,7 @@ use Config (); use Cwd (); use DirHandle; use Exporter (); +use Errno (); use ExtUtils::MakeMaker (); # $SelfLoader::DEBUG=1; use File::Basename (); use File::Copy (); @@ -575,7 +576,7 @@ Please make sure the directory exists and is writable. } my $fh; unless ($fh = FileHandle->new(">$lockfile")) { - if ($! =~ /Permission/) { + if ($!{EACCES} || $! =~ /Permission/) { my $incc = $INC{'CPAN/Config.pm'}; my $myincc = MM->catfile($ENV{HOME},'.cpan','CPAN','MyConfig.pm'); $CPAN::Frontend->myprint(qq{ -- cgit v1.2.1