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


in reply to Re^7: Iterating over hash while deleting elements (Best Practice)
in thread Iterating over an hash while removing keys

> 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
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re^8: Iterating over hash while deleting elements (Best Practice)