Interestingly, the code:
#!/usr/bin/perl
use warnings;
use strict;
my %hash;
my @array;
{
local $hash{foo} = 'bar';
local @array;
}
complains that you "Can't localize lexical variable @array", but it has no problem localizing $hash{foo}.
Even more interestingly, the code:
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
my %hash;
our @array;
{
local $hash{foo} = 'bar';
local @array;
print Dumper(\%main::);
}
shows that the localization of the hash slot does _not_ manipulate the symbol table--even without "use strict".