P is for Practical | |
PerlMonks |
Re: How do I make all the values in %a with common keys in %b equal to %b's keys?by Roy Johnson (Monsignor) |
on Nov 03, 2003 at 19:53 UTC ( [id://304228]=note: print w/replies, xml ) | Need Help?? |
CharlesClarkson's can be written without the use of a temp or slices:
which also benchmarks a little better. For clarity, I like vroom's solution. Note that if you know that one hash is much larger than the other, you will do better to iterate through the keys of the smaller hash and test exists against the larger.
In Section
Seekers of Perl Wisdom
|
|