5 strict - Perl pragma to restrict unsafe constructs
20 If no import list is supplied, all possible restrictions are assumed.
21 (This is the safest mode to operate in, but is sometimes too strict for
22 casual programming.) Currently, there are three possible things to be
23 strict about: "subs", "vars", and "refs".
29 This generates a runtime error if you
30 use symbolic references (see L<perlref>).
36 print $$ref; # runtime error; normally ok
40 This generates a compile-time error if you access a variable that wasn't
41 localized via C<my()> or wasn't fully qualified. Because this is to avoid
42 variable suicide problems and subtle dynamic scoping issues, a merely
43 local() variable isn't good enough. See L<perlfunc/my> and
47 $X::foo = 1; # ok, fully qualified
48 my $foo = 10; # ok, my() var
49 local $foo = 9; # blows up
51 The local() generated a compile-time error because you just touched a global
52 name without fully qualifying it.
56 This disables the poetry optimization,
57 generating a compile-time error if you
58 try to use a bareword identifier that's not a subroutine.
61 $SIG{PIPE} = Plumber; # blows up
62 $SIG{"PIPE"} = "Plumber"; # just fine
66 See L<perlmod/Pragmatic Modules>.
73 foreach $sememe (@_) {
74 $bits |= 0x00000002 if $sememe eq 'refs';
75 $bits |= 0x00000200 if $sememe eq 'subs';
76 $bits |= 0x00000400 if $sememe eq 'vars';
83 $^H |= bits(@_ ? @_ : qw(refs subs vars));
88 $^H &= ~ bits(@_ ? @_ : qw(refs subs vars));