good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: delete hash element while traversing via values coredumpedby ioannis (Abbot) |
on Jun 08, 2006 at 09:03 UTC ( [id://554240]=note: print w/replies, xml ) | Need Help?? |
It is not very difficult if you enable warnings; it says "Use of freed value in iteration". Note that $a{b} is deleted in both iterations, yet on on of the iterations it tries to derefence its value of the key (the value is already freed, along with the key.) The program decides to exit with die() and does not crash.
In Section
Seekers of Perl Wisdom
|
|