http://qs321.pair.com?node_id=1063544


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.