X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fstrict.pm;h=8492e933fd649bb3cc4c91188bb50269b3ba12fd;hb=6b8afdafd43a19a5a652c59255c9895c9bcbe27b;hp=d35c6c105c1be3d22701af0f463bbd8f4a0c8036;hpb=f06db76b9e41859439aeadb79feb6c603ee741ff;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/strict.pm b/lib/strict.pm index d35c6c1..8492e93 100644 --- a/lib/strict.pm +++ b/lib/strict.pm @@ -53,13 +53,17 @@ name without fully qualifying it. =item C -This disables the poetry optimization, -generating a compile-time error if you -try to use a bareword identifier that's not a subroutine. +This disables the poetry optimization, generating a compile-time error if +you try to use a bareword identifier that's not a subroutine, unless it +appears in curly braces or on the left hand side of the "=E" symbol. + use strict 'subs'; $SIG{PIPE} = Plumber; # blows up - $SIG{"PIPE"} = "Plumber"; # just fine + $SIG{PIPE} = "Plumber"; # just fine: bareword in curlies always ok + $SIG{PIPE} = \&Plumber; # preferred form + + =back @@ -70,10 +74,11 @@ See L. sub bits { my $bits = 0; + my $sememe; foreach $sememe (@_) { - $bits |= 0x00000002 if $sememe eq 'refs'; - $bits |= 0x00000200 if $sememe eq 'subs'; - $bits |= 0x00000400 if $sememe eq 'vars'; + $bits |= 0x00000002, next if $sememe eq 'refs'; + $bits |= 0x00000200, next if $sememe eq 'subs'; + $bits |= 0x00000400, next if $sememe eq 'vars'; } $bits; }