http://qs321.pair.com?node_id=11112502


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 element
Nice 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 ;-P
Spooky...