Here's another way to do that:
foreach my $key (keys %a) { $a{$key} = $b{$key} if exists $b{$key}; }
or
exists $b{$_} and $a{$_} = $b{$_} for keys %a;In reply to (dkubb) Re: (2) Answer: How do I make all the values in %a with common keys in %b equal to %b's keys?
by dkubb
in thread How do I make all the values in %a with common keys in %b equal to %b's values?
by draco_iii
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |