develooper Front page | perl.perl5.porters | Postings from February 2019

[perl #133823] strict does not ban all barewords

Thread Previous
From:
Chris Wagner
Date:
February 4, 2019 23:16
Subject:
[perl #133823] strict does not ban all barewords
Message ID:
rt-4.0.24-13859-1549322184-218.133823-75-0@perl.org
# New Ticket Created by  Chris Wagner 
# Please include the string:  [perl #133823]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=133823 >


Using the strict pragma does not ban all usages of barewords or force 
them to resolution as subroutines so that they can fail as an undefined 
subroutine.

Tested on Perl 5.22.4 and 5.29.8

Examples:
$ perl -MO=Deparse,-p,-q,-x20,-P -e 'use strict; print "$^X $^V\n"; my 
$string; print split FOO, $string; '
use strict;
print(((($^X . ' ') . $^V) . "\n"));
my($string);
print(split(/FOO/, $string, 0));
-e syntax OK



$ perl -MO=Deparse,-p,-q,-x20,-P -e 'use strict; print "$^X $^V\n"; my 
@list; print sort FOO @list; '
use strict;
print(((($^X . ' ') . $^V) . "\n"));
my(@list);
print((sort FOO @list));
-e syntax OK



Thanks.


Thread Previous


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