This generates a compile-time error if you access a variable that wasn't
localized via
my()
or wasn't fully qualified. Because this is to avoid
variable suicide problems and subtle dynamic scoping issues, a merely
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.