use strict;
use strict "vars"; use strict "refs"; use strict "subs";
use strict; no strict "vars";
use strict 'refs'; $ref = \$foo; print $$ref; # ok $ref = "foo"; print $$ref; # runtime error; normally ok
local
variable isn't good enough. See my and
local.
use strict 'vars'; $X::foo = 1; # ok, fully qualified my $foo = 10; # ok, my() var local $foo = 9; # blows up
The local
generated a compile-time error because you just
touched a global name without fully qualifying it.
use strict 'subs'; $SIG{PIPE} = Plumber; # blows up $SIG{PIPE} = "Plumber"; # just fine: bareword in curlies always ok $SIG{PIPE} = \&Plumber; # preferred form