Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: autovivication and referencing

by eye (Chaplain)
on Nov 20, 2013 at 15:32 UTC ( #1063544=note: print w/ replies, xml ) Need Help??


in reply to autovivication and referencing

While I don't disagree with what the details of the replies from hdb & sundialsvc4, I think we need to step back and be less literal.

The value associated with a hash key can only be a scalar. Setting the value to a list or a hash is an obfuscation at best. In this case, I would call it a coding error. Perl does what was requested, but not what was wanted. hdb's second reply shows how to correct the error by using braces to create a hash ref. Once the error is corrected, these scenarios are equivalent.

You can build a data structure piecemeal.


Comment on Re: autovivication and referencing

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-09-17 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (60 votes), past polls