develooper Front page | perl.perl5.porters | Postings from May 2016

[perl #128245] 'perldoc -f open' :encoding clarification

Thread Next
From:
John Harig
Date:
May 28, 2016 12:18
Subject:
[perl #128245] 'perldoc -f open' :encoding clarification
Message ID:
rt-4.0.18-24290-1464253506-336.128245-75-0@perl.org
# New Ticket Created by  John Harig 
# Please include the string:  [perl #128245]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128245 >


This is a bug report for perl from john.harig@booking.com,
generated with the help of perlbug 1.40 running under perl 5.25.2.


-----------------------------------------------------------------
[Please describe your issue here]

An example contained in 'perldoc -f open' states to use :encoding.
When running 'perldoc encoding', it goes to a page for the encoding
pragma which is deprecated as of 5.18.	However, the 'open' reference
is actually to PerlIO::encoding.  To avoid confusion, I have added a
phrase to the 'open' section of perlfunc.pm to avoid confusion. 

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=docs
    severity=low
    Type=Patch
    PatchStatus=HasPatch
---
Site configuration information for perl 5.25.2:

Configured by user01 at Wed May 25 19:22:33 CEST 2016.

Summary of my perl5 (revision 5 version 25 subversion 2) configuration:
  Derived from: cbef69c1c0b28f5a8e50e67afea1ff67dcce20aa
  Platform:
    osname=linux, osvers=4.5.0-0.bpo.2-amd64, archname=x86_64-linux
    uname='linux nyc3-186 4.5.0-0.bpo.2-amd64 #1 smp debian 4.5.3-2~bpo8+1 (2016-05-13) x86_64 gnulinux '
    config_args='-des -Dusedevel'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2',
    optimize='-O2',
    cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion='', gccversion='4.9.2', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
    libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.19'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Locally applied patches:
    uncommitted-changes

---
@INC for perl 5.25.2:
    lib
    /home/user01/perl5/lib/perl5
    /usr/local/lib/perl5/site_perl/5.25.2/x86_64-linux
    /usr/local/lib/perl5/site_perl/5.25.2
    /usr/local/lib/perl5/5.25.2/x86_64-linux
    /usr/local/lib/perl5/5.25.2
    .

---
Environment for perl 5.25.2:
    HOME=/home/user01
    LANG=en_US.utf8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/user01/perl5/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
    PERL5LIB=/home/user01/perl5/lib/perl5
    PERL_BADLANG (unset)
    PERL_LOCAL_LIB_ROOT=/home/user01/perl5
    PERL_MB_OPT=--install_base "/home/user01/perl5"
    PERL_MM_OPT=INSTALL_BASE=/home/user01/perl5
    SHELL=/bin/bash

--------------1.40.perlbug
Content-Type: text/x-patch; name="0001-pod-text-insertion-regarding-encoding-in-open-functi.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-pod-text-insertion-regarding-encoding-in-open-functi.patch"

>From 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


--------------1.40.perlbug--
Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About