use strict; use warnings; use Data::Dumper; my %hash = (1 => 2, 3 => 4); BLOCK: { local $hash{1} = 5; print Dumper \%hash; } print Dumper \%hash;