You may want to reconsider what you've said here.
use strict;
use warnings;
use Data::Dumper;
my %hash = (1 => 2, 3 => 4);
BLOCK: {
local $hash{1} = 5;
print Dumper \%hash;
}
print Dumper \%hash;
What you've said is true for localizing lexical scalars; however localizing values in lexical arrays and hashes is no problem. See
When to Still Use local(), item #3. Sorry if I've misread your intent.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.