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
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re^8: Iterating over hash while deleting elements (Best Practice)
by LanX
in thread Iterating over an hash while removing keys
by Eily
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |