diff options
-rw-r--r-- | ext/DB_File/DB_File.pm | 3 | ||||
-rw-r--r-- | ext/Fcntl/Fcntl.pm | 3 | ||||
-rw-r--r-- | ext/GDBM_File/GDBM_File.pm | 3 | ||||
-rw-r--r-- | jpl/JNI/JNI.pm | 3 | ||||
-rw-r--r-- | lib/AutoLoader.pm | 3 | ||||
-rw-r--r-- | lib/CPAN.pm | 3 | ||||
-rw-r--r-- | pod/perllocale.pod | 8 | ||||
-rw-r--r-- | utils/h2xs.PL | 5 |
8 files changed, 21 insertions, 10 deletions
diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm index 7dd1d26360..90a82b8fca 100644 --- a/ext/DB_File/DB_File.pm +++ b/ext/DB_File/DB_File.pm @@ -15,6 +15,7 @@ require 5.003 ; use strict; use Carp; +use Errno; require Tie::Hash; @DB_File::HASHINFO::ISA = qw(Tie::Hash); @@ -196,7 +197,7 @@ sub AUTOLOAD { ($constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { - if ($! =~ /Invalid/) { + if ($!{EINVAL} || $! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index 00f834d223..664c2cb28d 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -44,6 +44,7 @@ what constants are implemented in your system. use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD); +use Errno; require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); @@ -122,7 +123,7 @@ sub AUTOLOAD { (my $constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname, 0); if ($! != 0) { - if ($! =~ /Invalid/) { + if ($!{EINVAL} || $! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } diff --git a/ext/GDBM_File/GDBM_File.pm b/ext/GDBM_File/GDBM_File.pm index aff01527dc..1d90a341f5 100644 --- a/ext/GDBM_File/GDBM_File.pm +++ b/ext/GDBM_File/GDBM_File.pm @@ -43,6 +43,7 @@ use strict; use vars qw($VERSION @ISA @EXPORT $AUTOLOAD); require Carp; +use Errno; require Tie::Hash; require Exporter; use AutoLoader; @@ -66,7 +67,7 @@ sub AUTOLOAD { ($constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { - if ($! =~ /Invalid/) { + if ($!{EINVAL} || $! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } diff --git a/jpl/JNI/JNI.pm b/jpl/JNI/JNI.pm index 7797ad632a..455a130d9f 100644 --- a/jpl/JNI/JNI.pm +++ b/jpl/JNI/JNI.pm @@ -2,6 +2,7 @@ package JNI; use strict; use Carp; +use Errno; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD $JVM @JVM_ARGS $JAVALIB); require Exporter; @@ -198,7 +199,7 @@ sub AUTOLOAD { ($constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { - if ($! =~ /Invalid/) { + if ($!{EINVAL} || $! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } 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{ diff --git a/pod/perllocale.pod b/pod/perllocale.pod index 08b50e0d12..0447b26e8e 100644 --- a/pod/perllocale.pod +++ b/pod/perllocale.pod @@ -608,8 +608,12 @@ obeys the current C<LC_TIME> locale. The remaining locale category, C<LC_MESSAGES> (possibly supplemented by others in particular implementations) is not currently used by -Perl--except possibly to affect the behavior of library functions called -by extensions outside the standard Perl distribution. +Perl--except possibly to affect the behavior of library functions +called by extensions outside the standard Perl distribution and by the +operating system and its utilities. Note especially that the string +value of C<$!> and the error messages given by external utilities may +be changed by C<LC_MESSAGES>. If you want to have portable error +codes, use the Errno extension. =head1 SECURITY diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 3650512a57..710242aedb 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -117,7 +117,7 @@ Specifies a name to be used for the extension, e.g., S<-n RPC::DCE> Specify a prefix which should be removed from the Perl function names, e.g., S<-p sec_rgy_> This sets up the XS B<PREFIX> keyword and removes the prefix from functions that are -autoloaded via the C<constant()> mechansim. +autoloaded via the C<constant()> mechanism. =item B<-s> I<sub1,sub2> @@ -419,6 +419,7 @@ else{ # will want Carp. print PM <<'END'; use Carp; +use Errno; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); END } @@ -471,7 +472,7 @@ sub AUTOLOAD { croak "&$module::constant not defined" if \$constname eq 'constant'; my \$val = constant(\$constname, \@_ ? \$_[0] : 0); if (\$! != 0) { - if (\$! =~ /Invalid/) { + if (\$!{EINVAL} || \$! =~ /Invalid/) { \$AutoLoader::AUTOLOAD = \$AUTOLOAD; goto &AutoLoader::AUTOLOAD; } |