Skip Menu |
Report information
Id: 131518
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: ronaldxs <ronaldxs [at] software-path.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: docs
Perl Version: 5.26.0
Fixed In: 5.27.8

Attachments
0001-perlrun-warn-on-mpragma-eg-strict-blindsiding.patch



Subject: [PATCH] -mpragma (eg strict) fail silent blindsiding
To: perlbug [...] perl.org
Date: Tue, 06 Jun 2017 16:28:27 +0200
From: Ronald Schmidt <ronaldxs [...] software-path.com>
Download (untitled) / with headers
text/plain 4.2k
This is a bug report for perl from ronaldxs@software-path.com, generated with the help of perlbug 1.40 running under perl 5.26.0. ----------------------------------------------------------------- [Please describe your issue here] document -mpragma (eg strict) fail silent "perl -Mstrict" is used all the time and I noticed that "perl -mstrict" (lower case -m) runs without "strict" being in effect. It seems to me to be a potentially dangerous surprise and while the docs note that "-m" uses an empty import list it also seems to currently take a little too much expertise and digging to understand the effect of the empty import list on pragma(ta|s). A programmer using Perl should not need to know how to write a custom pragma to understand that -mstrict does not work because of the empty import list. This patch to perlrun.pod is a proposed remedy. [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=docs severity=low Type=Patch PatchStatus=HasPatch --- Site configuration information for perl 5.26.0: Configured by ron at Mon Jun 5 13:50:57 EDT 2017. Summary of my perl5 (revision 5 version 26 subversion 0) configuration: Local Commit: b85ff045c4480eca8989420062c698a819c47105 Ancestor: 5ad96e9e32a29f927d3e9dec23fd1d7d3e89665f Platform: osname=linux osvers=4.4.0-31-generic archname=x86_64-linux uname='linux ws-ubuntu 4.4.0-31-generic #50~14.04.1-ubuntu smp wed jul 13 01:07:32 utc 2016 x86_64 x86_64 x86_64 gnulinux ' config_args='' hint=recommended useposix=true d_sigaction=define useithreads=undef usemultiplicity=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='cc' ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' optimize='-O2' cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='' gccversion='4.8.4' 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 -L/usr/local/lib' libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.8/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 -lgdbm -ldl -lm -lcrypt -lutil -lc -lgdbm_compat 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' Locally applied patches: b85ff045c4480eca8989420062c698a819c47105 --- @INC for perl 5.26.0: lib /usr/local/lib/perl5/site_perl/5.26.0/x86_64-linux /usr/local/lib/perl5/site_perl/5.26.0 /usr/local/lib/perl5/5.26.0/x86_64-linux /usr/local/lib/perl5/5.26.0 --- Environment for perl 5.26.0: HOME=/home/ron LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/ron/perl5/perlbrew/bin:/home/ron/.rvm/gems/ruby-2.4.0-rc1/bin:/home/ron/.rvm/gems/ruby-2.4.0-rc1@global/bin:/home/ron/.rvm/rubies/ruby-2.4.0-rc1/bin:/home/ron/.rakudobrew/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ron/.rakudobrew/moar-nom/install/share/perl6/site/bin:/home/ron/bin:/home/ron/.rvm/bin PERLBREW_BASHRC_VERSION=0.78 PERLBREW_HOME=/home/ron/.perlbrew PERLBREW_PATH=/home/ron/perl5/perlbrew/bin PERLBREW_ROOT=/home/ron/perl5/perlbrew PERLBREW_VERSION=0.78 PERL_BADLANG (unset) SHELL=/bin/bash

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.3k
On Tue, 06 Jun 2017 14:44:56 GMT, ronaldxs wrote: Show quoted text
> This is a bug report for perl from ronaldxs@software-path.com, > generated with the help of perlbug 1.40 running under perl 5.26.0. > > > ----------------------------------------------------------------- > [Please describe your issue here] > document -mpragma (eg strict) fail silent > > "perl -Mstrict" is used all the time and I noticed that "perl > -mstrict" > (lower case -m) runs without "strict" being in effect. It seems to > me to be a potentially dangerous surprise and while the docs note that > "-m" uses an empty import list it also seems to currently take a > little > too much expertise and digging to understand the effect of the empty > import list on pragma(ta|s). > > A programmer using Perl should not need to know how to write a custom > pragma to understand that -mstrict does not work because of the empty > import list. This patch to perlrun.pod is a proposed remedy. >
I think your argument is correct and the patch should be applied. However, I think something is amiss in the syntax of this part: ##### ... prevents the call to import usually used by a pragma set active and other status for the current scope ##### Something about "set active and other status" doesn't sound right. Can you clarify? Thank you very much. -- James E Keenan (jkeenan@cpan.org)
Date: Sat, 30 Dec 2017 11:52:50 +0000
To: perl5-porters [...] perl.org
Subject: Re: [perl #131518] [PATCH] -mpragma (eg strict) fail silent blindsiding
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 103b
Fixed with a different documentation edit in commit e2bcc7d7ec67c661405135f9b00232631a97f2fb. -zefram
Download (untitled) / with headers
text/plain 317b
Thank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been resolved. Perl 5.28.0 may be downloaded via: https://metacpan.org/release/XSAWYERX/perl-5.28.0 If you find that the problem persists, feel free to reopen this ticket.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org