From: Gurusamy Sarathy <gsar@cpan.org> Date: Sat, 19 Feb 2000 17:15:34 +0000 (+0000) Subject: avoid failing on $!{ENOTHERE} (they can always use C<exists $!{NOTHERE}> X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=93014de6975a5818b25c37acbc52a655889dc308;p=p5sagit%2Fp5-mst-13.2.git avoid failing on $!{ENOTHERE} (they can always use C<exists $!{NOTHERE}> for that) p4raw-id: //depot/perl@5147 --- diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index 75dacfc..adf8902 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -235,9 +235,8 @@ sub FETCH { no strict 'refs'; return $! == &$errname; } - require Carp; - Carp::confess("No errno $errname"); -} + return ""; +} sub STORE { require Carp; @@ -252,7 +251,6 @@ sub NEXTKEY { while(($k,$v) = each %Errno::) { my $proto = prototype("Errno::$k"); last if (defined($proto) && $proto eq ""); - } $k } @@ -287,8 +285,8 @@ C<Errno> defines and conditionally exports all the error constants defined in your system C<errno.h> include file. It has a single export tag, C<:POSIX>, which will export all POSIX defined error numbers. -C<Errno> also makes C<%!> magic such that each element of C<%!> has a non-zero -value only if C<$!> is set to that value, eg +C<Errno> also makes C<%!> magic such that each element of C<%!> has a +non-zero value only if C<$!> is set to that value, eg use Errno; @@ -300,6 +298,10 @@ value only if C<$!> is set to that value, eg } } +If a specified constant C<EFOO> doesn't exist on the system, C<$!{EFOO}> +has a false value. You may use C<exists $!{EFOO}> to check whether the +constant is available on the system. + =head1 AUTHOR Graham Barr <gbarr@pobox.com>