in reply to Why does this dump core?
I was wondering if deleting keys while iterating over a hash was reallocating the buckets and perhaps Perl was then trying to access memory that's not there. According to Adding or removing keys while iterating over a hash, this is not the case. I can't add, but I should have no problem deleting. Both merlyn and Dominus state that. However, what's vexing about this is that it appears similar to a Perl4 issue where deleting from a hash while iterating over it was verboten. This was fixed in Perl5.
Forgetting the keys should certainly cause the code to fail, but generating a core dump? That's certainly going to cause some people to panic :)
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Ovid) Re: Why does this dump core?
by danger (Priest) on Dec 12, 2001 at 01:25 UTC |