Since the values of your first hash are keys into your second hash, you don't need to do so much looping:
for my $k1 (keys %hash1) { my $k2 = $hash1{$k1}; $hash1{$k1} = $hash2{$k2} if exists $hash2{$k2}; }
In reply to Re: Replace the value of a hash
by duff
in thread Replace the value of a hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |