3 strict - Perl pragma to restrict unsafe constructs
18 If no import list is supplied, all possible restrictions are assumed.
19 (This is the safest mode to operate in, but is sometimes too strict for
20 casual programming.) Currently, there are three possible things to be
21 strict about: "subs", "vars", and "refs".
27 This generates a runtime error if you
28 use symbolic references (see L<perlref>).
34 print $$ref; # runtime error; normally ok
38 This generates a compile-time error if you access a variable that wasn't
39 localized via C<my()> or wasn't fully qualified. Because this is to avoid
40 variable suicide problems and subtle dynamic scoping issues, a merely
41 local() variable isn't good enough. See L<perlfunc/my> and
45 $X::foo = 1; # ok, fully qualified
46 my $foo = 10; # ok, my() var
47 local $foo = 9; # blows up
49 The local() generated a compile-time error because you just touched a global
50 name without fully qualifying it.
54 This disables the poetry optimization,
55 generating a compile-time error if you
56 try to use a bareword identifier that's not a subroutine.
59 $SIG{PIPE} = Plumber; # blows up
60 $SIG{"PIPE"} = "Plumber"; # just fine
64 See L<perlmod/Pragmatic Modules>.