in reply to Iterating over hash while deleting elements
in thread Iterating over an hash while removing keys
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...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Iterating over hash while deleting elements
by LanX (Saint) on Feb 06, 2020 at 17:05 UTC | |
by Eily (Monsignor) on Feb 06, 2020 at 17:07 UTC | |
by LanX (Saint) on Feb 06, 2020 at 17:21 UTC | |
by Eily (Monsignor) on Feb 06, 2020 at 17:29 UTC | |
by LanX (Saint) on Feb 07, 2020 at 11:52 UTC | |
|