Don't ask to ask, just ask | |
PerlMonks |
Re^8: Iterating over hash while deleting elements (Best Practice)by LanX (Saint) |
on Feb 07, 2020 at 14:23 UTC ( [id://11112566]=note: print w/replies, xml ) | Need Help?? |
> What's wrong with getting a new iterator as long as the function is documented to reset it? My approach is more generic because you don't need to delete the whole hash. You could probably also use a simple for loop and just next if the key doesn't exist anymore.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|