Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Hash assignment: Undocumented feature?

by sundialsvc4 (Abbot)
on Aug 13, 2013 at 04:17 UTC ( #1049208=note: print w/ replies, xml ) Need Help??

in reply to Hash assignment: Undocumented feature?

I simply read the OP as denoting uncertainty as to exactly what will happen if the same key is specified more-than-once in a hash initialization statement such as the one shown.   The definitive and now-documented answer seems to be:   that the initialization will reliably proceed left-to-right ... so that the rightmost occurrence of any key, by virtue of being the last assignment that is made for that particular key as the statement is executed, will always “win.”   Perl will not, so far as I know, generate any errors or warnings ... it probably isn’t what you meant to do, but it’s not illegal.

Comment on Re: Hash assignment: Undocumented feature?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1049208]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-12-28 14:25 GMT
Find Nodes?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?

    Results (181 votes), past polls