![]() |
|
No such thing as a small change | |
PerlMonks |
Re: Iterating over hash while deleting elementsby Eily (Monsignor) |
on Feb 06, 2020 at 17:02 UTC ( #11112502=note: print w/replies, xml ) | Need Help?? |
each has no problem if you delete the current elementNice to know but I wouldn't rely on it. I think "don't use each if the hash changes" is an easier rule to follow/understand. And it's safer against possible future changes as well (you might start by only deleting the current key, and then find out you can delete a few more at the same time). Question to follow ;-PSpooky...
In Section
Seekers of Perl Wisdom
|
|