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
'perldoc -f open' :encoding clarification #15361
Comments
From john.harig@booking.comCreated by john.harig@booking.comAn example contained in 'perldoc -f open' states to use :encoding. Perl Info
|
From john.harig@booking.com0001-pod-text-insertion-regarding-encoding-in-open-functi.patchFrom 8acb834322dca79dfdaf5a47e9fae6b849608652 Mon Sep 17 00:00:00 2001
From: user01 <user01@NYC-186.booking.pcln.com>
Date: Wed, 25 May 2016 19:41:19 +0200
Subject: [PATCH] pod text insertion regarding :encoding in open function
---
cpan/Pod-Perldoc/corpus/perlfunc.pod | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cpan/Pod-Perldoc/corpus/perlfunc.pod b/cpan/Pod-Perldoc/corpus/perlfunc.pod
index 604123d..7c6e6ee 100644
--- a/cpan/Pod-Perldoc/corpus/perlfunc.pod
+++ b/cpan/Pod-Perldoc/corpus/perlfunc.pod
@@ -3539,7 +3539,9 @@ three-argument form, then default layers stored in ${^OPEN} (see L<perlvar>;
usually set by the B<open> pragma or the switch B<-CioD>) are ignored.
Those layers will also be ignored if you specifying a colon with no name
following it. In that case the default layer for the operating system
-(:raw on Unix, :crlf on Windows) is used.
+(:raw on Unix, :crlf on Windows) is used. For clarification, C<:encoding> in
+the above example is a reference to the core module L<PerlIO::encoding>, and
+not to the deprecated (as of version 5.18) L<encoding> pragma.
Open returns nonzero on success, the undefined value otherwise. If
the C<open> involved a pipe, the return value happens to be the pid of
--
2.1.4
|
From @khwilliamsonOn 05/26/2016 03:05 AM, John Harig (via RT) wrote:
This patch should be instead against pod/perlfunc.pod. I'll apply your patch if you instead redo it against perlfunc. And do |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Thu May 26 02:05:06 2016, john.harig@booking.com wrote:
Besides the problems Jim mentioned, wouldn't something like the attached be simpler and clearer (since it's attached directly to the example) Tony |
From @tonycoz0001-perl-128245-make-it-obvious-encoding-uses-PerlIO-enc.patchFrom 547765fad89d3471995ec84ee548ba4253dbce30 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Mon, 11 Jul 2016 10:52:20 +1000
Subject: (perl #128245) make it obvious :encoding uses PerlIO::encoding
rather than encoding.pm
---
pod/perlfunc.pod | 1 +
1 file changed, 1 insertion(+)
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 5c778f1..4c013ae 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -4343,6 +4343,7 @@ I/O layers (sometimes referred to as "disciplines") to apply to the handle
that affect how the input and output are processed (see L<open> and
L<PerlIO> for more details). For example:
+ # loads PerlIO::encoding automatically
open(my $fh, "<:encoding(UTF-8)", $filename)
|| die "Can't open UTF-8 encoded $filename: $!";
--
2.1.4
|
From @tonycozOn Sun Jul 10 17:53:55 2016, tonyc wrote:
Oops, that was Karl, sorry. Tony |
From @cpansproutOn Sun Jul 10 17:53:55 2016, tonyc wrote:
Yes, shorter is better (and clearer!) in this particular case. -- Father Chrysostomos |
From john.harig@booking.comCreated by john.harig@booking.comAn example contained in 'perldoc -f open' states to use :encoding. Perl Info
|
From john.harig@booking.com0001-perlfunc.pod-text-update-on-open-function-encoding.patchFrom 4801086fdc8748d2add2a8126d76397ac8c6de2f Mon Sep 17 00:00:00 2001
From: John Harig <john.harig@booking.com>
Date: Mon, 30 May 2016 10:59:04 +0200
Subject: [PATCH] perlfunc.pod text update on open function - :encoding
---
pod/perlfunc.pod | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 5c778f1..2104eac 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -4352,7 +4352,9 @@ three-argument form, then default layers stored in ${^OPEN} (see L<perlvar>;
usually set by the L<open> pragma or the switch C<-CioD>) are ignored.
Those layers will also be ignored if you specifying a colon with no name
following it. In that case the default layer for the operating system
-(:raw on Unix, :crlf on Windows) is used.
+(:raw on Unix, :crlf on Windows) is used. For clarification, C<:encoding> in
+the above example is a reference to the core module L<PerlIO::encoding>, and
+not to the deprecated (as of version 5.18) L<encoding> pragma.
Open returns nonzero on success, the undefined value otherwise. If
the L<C<open>|/open FILEHANDLE,EXPR> involved a pipe, the return value
--
2.1.4
|
I (finally) applied Tony's patch as a933fcc |
Migrated from rt.perl.org#128245 (status was 'open')
Searchable as RT128245$
The text was updated successfully, but these errors were encountered: