Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Why does this dump core?by danger (Priest) |
on Dec 11, 2001 at 15:34 UTC ( [id://130909]=note: print w/replies, xml ) | Need Help?? |
This is likely related to this change in 5.6 (from perldelta):
Previously, only copies were used, which meant that foreach-aliasing didn't really alias into the real hash values:
As you can see, with 5.005, even after we've changed the value for the key 'beer', we still get the old value because it was a copy. In 5.6 we get the new value because it is an alias into the hash. Now, in your situation, after deleting the key '*test' the next iteration involves an alias to a non-existing value and this is causing a problem for perl (which with -w gives "attempt to free unreferenced scalar", and a segfault otherwise).
In Section
Seekers of Perl Wisdom
|
|