diff options
author | Lukas Mai <l.mai@web.de> | 2013-08-19 07:07:17 +0200 |
---|---|---|
committer | Lukas Mai <l.mai@web.de> | 2016-11-11 16:14:44 +0100 |
commit | edf1328fc150ae2e505093d38edebf657a33c5fd (patch) | |
tree | ce6ee7c213aa30bb0b74b4e02a8dd04e92ae19c3 /ext/Errno | |
parent | 21196d16faa6174b1665a81e3d93087943eabfc0 (diff) | |
download | perl-edf1328fc150ae2e505093d38edebf657a33c5fd.tar.gz |
Errno: mention that using %! autoloads Errno (RT #119359)
Also use lexical filehandles/3-arg open in example.
Diffstat (limited to 'ext/Errno')
-rw-r--r-- | ext/Errno/Errno_pm.PL | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index 3c5c443c03..8b1286dde6 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -2,7 +2,7 @@ use ExtUtils::MakeMaker; use Config; use strict; -our $VERSION = "1.26"; +our $VERSION = "1.27"; my %err = (); @@ -280,7 +280,8 @@ sub write_errno_pm { print <<"EDQ"; # -*- buffer-read-only: t -*- # -# This file is auto-generated. ***ANY*** changes here will be lost +# This file is auto-generated by ext/Errno/Errno_pm.PL. +# ***ANY*** changes here will be lost. # package Errno; @@ -435,9 +436,8 @@ file. These are included in a second export tag, C<:WINSOCK>. 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. For example: - use Errno; - - unless (open(FH, "/fangorn/spouse")) { + my $fh; + unless (open($fh, "<", "/fangorn/spouse")) { if ($!{ENOENT}) { warn "Get a wife!\n"; } else { @@ -449,6 +449,9 @@ If a specified constant C<EFOO> does not exist on the system, C<$!{EFOO}> returns C<"">. You may use C<exists $!{EFOO}> to check whether the constant is available on the system. +Perl automatically loads C<Errno> the first time you use C<%!>, so you don't +need an explicit C<use>. + =head1 CAVEATS Importing a particular constant may not be very portable, because the |