note
calin
Be aware that <code>each</code> keeps state, so adding or deleting elements
in an <code>each</code> loop is not the greatest of ideas. However, your pattern
of usage seems to be supported, though I wouldn't recommend it.
<p>
Quote from <code>perldoc -f each</code>
<p>
<blockquote>
<p>
<em>
If you add or delete elements of a hash while you're
iterating over it, you may get entries skipped or
duplicated, so don't. Exception: It is always
safe to delete the item most recently returned by
"each()", which means that the following code will
work:
</em>
</p>
<p>
<code>
while (($key, $value) = each %hash) {
print $key, "\n";
delete $hash{$key}; # This is safe
}
</code>
</p>
</blockquote>
328499
328499