Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2018-04-19 10:08 GMT
Find Nodes?
    Voting Booth?