New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perlvar/Errno contradict each other about %! #13177
Comments
From @maukeCreated by @maukeThis bug report is about the documentation for %!. perldoc perlvar says: %! Each element of "%!" has a true value only if $! is set to that value. perldoc Errno says: "Errno" also makes "%!" magic such that each element of "%!" has a non-zero So which is it? Is %! a normal builtin variable like $! (and therefore always Perl Info
|
From victor@vsespb.ruSeems Errno.pm is auto-loaded when accessing %! $perl -e 'print join q{ }, keys %INC'
see perl 5005delta: also, I think there was a discussion about it 2013/8/19 l.mai@web.de <perlbug-followup@perl.org>
|
The RT System itself - Status changed from 'new' to 'open' |
From ebhanssen@allverden.noThat could surely be expressed more clearly, but they don't actually eirik@greencat[01:02:27] |
From @maukeOn Sun Aug 18 16:00:53 2013, vsespb wrote:
5.18.0/pod/perl5005delta.pod#%!_is_transparently_tied_to_the_Errno_module
Ah, thanks. I've attached three patches to ext/Errno/Errno_pm.PL. - The first one adds the autoloading thing to the Errno documentation. What do you think? |
From @mauke0002-Errno-mention-what-script-it-was-generated-from.patchFrom 322b0e994a1566e15e1d4604378e63c2e01e6915 Mon Sep 17 00:00:00 2001
From: Lukas Mai <l.mai@web.de>
Date: Mon, 19 Aug 2013 07:09:36 +0200
Subject: [PATCH 2/3] Errno - mention what script it was generated from
---
ext/Errno/Errno_pm.PL | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index acc23e8..b67c597 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -283,7 +283,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;
--
1.8.1.5
|
From @mauke0003-Errno-lexical-filehandles-3-arg-open-in-example.patchFrom 2ac228fd8f0c134d9978b91228942626050eb8cb Mon Sep 17 00:00:00 2001
From: Lukas Mai <l.mai@web.de>
Date: Mon, 19 Aug 2013 07:10:26 +0200
Subject: [PATCH 3/3] Errno - lexical filehandles/3-arg open in example
---
ext/Errno/Errno_pm.PL | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index b67c597..df49288 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -412,9 +412,8 @@ 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. For example:
- use Errno;
-
- unless (open(FH, "/fangorn/spouse")) {
+ my $fh;
+ unless (open($fh, "<", "/fangorn/spouse")) {
if ($!{ENOENT}) {
warn "Get a wife!\n";
} else {
--
1.8.1.5
|
From @mauke0001-Errno-mention-that-using-autoloads-Errno.patchFrom c056eee256b4366be2d4965677c29406e9e5818f Mon Sep 17 00:00:00 2001
From: Lukas Mai <l.mai@web.de>
Date: Mon, 19 Aug 2013 07:07:17 +0200
Subject: [PATCH 1/3] Errno - mention that using %! autoloads Errno
---
ext/Errno/Errno_pm.PL | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index b372875..acc23e8 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -425,6 +425,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
--
1.8.1.5
|
From victor@vsespb.ruI think OP submited some patches to RT ( 2013/8/19 Eirik Berg Hanssen via RT <perlbug-followup@perl.org>
|
From victor@vsespb.ruI wonder. Currently programmer doesn't have to list Errno.pm in prerequirements And if we explicitly document relation between Errno and %!, will above On Sun Aug 25 01:27:02 2013, vsespb wrote:
|
From @maukeOn Sun, 18 Aug 2013 22:18:29 -0700, mauke- wrote:
Applied as edf1328. |
@mauke - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#119359 (status was 'resolved')
Searchable as RT119359$
The text was updated successfully, but these errors were encountered: