Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Arrow Operator Question

by tobyink (Canon)
on Mar 26, 2023 at 11:54 UTC ( [id://11151231]=note: print w/replies, xml ) Need Help??


in reply to Arrow Operator Question

As others have said, it's autovivification.

As a quick way to explain why the 'c' key gets created, but not 'd' though: $a->{b}{c}{d} is looking for a 'd' key within $a->{b}{c}, so you are asserting that $a->{b}{c} must be a hashref for your program to succeed at all. So Perl makes it a hashref for you. But you're not asserting anything in particular about the nature of $a->{b}{c}{d}, so Perl doesn't make it anything.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-18 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found