in reply to Re: How do I make all the values in %a with common keys in %b equal to %b's keys?
in thread How do I make all the values in %a with common keys in %b equal to %b's values?

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;
  • Comment on (dkubb) Re: (2) Answer: How do I make all the values in %a with common keys in %b equal to %b's keys?
  • Select or Download Code