in reply to Re: Hash Copy Decipher???
in thread Hash Copy Decipher???

I hesitate to question chromatic on such things, but is the second part of that necessarily true? Since the elements of %$tsh are interpolated into a list, what we have is a list assignment to a hash where the same key may appear more than once, and my impression was that it was undefined which of the two values would be used. OTOH, I looked in perldata just now and the only mention I could find of this topic was:
A hash can be initialized using a literal list holding pairs of items to be interpreted as a key and a value:
and no mention of what happens when a key is duplicated.

Replies are listed 'Best First'.
Re^3: Hash Copy Decipher???
by chromatic (Archbishop) on Apr 25, 2007 at 21:14 UTC
    I hesitate to question chromatic on such things, but is the second part of that necessarily true?

    Hash keys don't have (easily identifiable) order, but lists certainly do.

    There's no requirement that a tied hash do anything specific when overwriting an existing key, but if Perl suddenly changes the order of operations when processing lists, you'll know it.