|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Re: how do I efficiently remove one hash from another?by davido (Bishop) |
| on Nov 27, 2012 at 07:11 UTC ( #1005803=note: print w/ replies, xml ) | Need Help?? |
|
Whether the loop is explicit, or implicit, there's a loop. But one cool means is:
...which is pretty much the same thing as...
...but with an implicit loop (via the hash slice) rather than the explicit 'for' loop. Note in either case, there's no need to worry about checking exists: delete doesn't complain if the element doesn't already exist. Dave
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||