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

Hash slices may make you unhappy. The above will introduce %b's keys into %a regardless of whether they existed in %a or not. Consider
my %a = ( A => 1, B => 2, C => 3 ); my %b = ( A => 100, D => 200 ); @a{keys %b} = values %b; print( "$_ => $a{$_}\n" ) foreach( sort keys %a );
  • Comment on Re: How do I make all the values in %a with common keys in %b equal to %b's keys?
  • Download Code