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 reply to Re: Iterating over hash while deleting elements
by Eily
in thread Iterating over an hash while removing keys
by Eily
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |