Add new globals to perl.exp
[p5sagit/p5-mst-13.2.git] / lib / strict.pm
index d35c6c1..8492e93 100644 (file)
@@ -53,13 +53,17 @@ name without fully qualifying it.
 
 =item C<strict subs>
 
-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<gt>" 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<perlmod/Pragmatic Modules>.
 
 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;
 }