use strict; # apply all possible restrictions use strict 'vars'; # restrict unsafe use of variables for rest of block use strict 'refs'; # restrict unsafe use of references for rest of block use strict 'subs'; # restrict unsafe use of subroutines for rest of block no strict 'vars'; # void restrictions on variables for rest of block no strict 'refs'; # void restrictions on references for rest of block no strict 'subs'; # void restrictions on subroutines for rest of block ***** use strict 'refs'; $ref = \$foo; print $$ref; # ok $ref = "foo"; print $$ref; # run-time error; normally ok ***** use strict 'vars'; use vars '$foe'; $SomePack::fee = 1; # ok, fully qualified my $fie = 10; # ok, my() var $foe = 7; # ok, pseudo-imported by 'use vars' $foo = 9; # blows up--did you mistype $foe maybe? ***** use strict 'subs'; $SIG{PIPE} = Plumber; # blows up (assuming Plumber sub not defined yet) $SIG{PIPE} = "Plumber"; # okay, means "main::Plumber" really $SIG{PIPE} = \&Plumber; # preferred form ***** use strict; # or just: use strict subs; [ ... ] no strict subs; # WRONG! Should be: no strict 'subs'; [ ... ] ***** use subs qw(sub1 sub2 sub3); sub1 $arg1, $arg2;