my $foo; local $foo # WRONG my %foo; local %foo; # WRONG my %foo; local $foo{key} = 'value'; # OK use vars qw ($var); $var=5; local $var = 10; # OK