my %h1 = (qw/a 1 b 2 c 3 d 4/); print 'h1 : ', Dumper \%h1; for (keys %h1) { $h1{$_} = '44' if $h1{$_} eq '4'; } print 'h1 : ', Dumper \%h1;