Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Hash assignment: Undocumented feature?

by sundialsvc4 (Monsignor)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2014-09-18 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (108 votes), past polls