This is likely related to this change in 5.6 (from perldelta):

=head2 delete(), each(), values() and hash iteration are faster The hash values returned by delete(), each(), values() and hashes in a list context are the actual values in the hash, instead of copies. This results in significantly better performance, because it eliminate +s needless copying in most situations.

Previously, only copies were used, which meant that foreach-aliasing didn't really alias into the real hash values:

my %hash = (name => 'andrew', beer => 'Ale'); foreach my $KV (%hash) { print ">>$KV<<\n"; $hash{$KV} = 'Dark Ale' if $KV eq 'beer'; } __END__ # with 5.00503: >>name<< >>andrew<< >>beer<< >>Ale<< # with 5.6.1 >>beer<< >>Dark Ale<< >>name<< >>andrew<<

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 reply to Re: Why does this dump core? by danger
in thread Why does this dump core? by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.