Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: When DOESN'T "Use of uninitialized value" show up?

by moritz (Cardinal)
on Dec 17, 2011 at 08:36 UTC ( [id://944049]=note: print w/replies, xml ) Need Help??


in reply to Re^3: When DOESN'T "Use of uninitialized value" show up?
in thread When DOESN'T "Use of uninitialized value" show up?

"b => {}" is required so that the presence of {c} can be checked.

And that's the part where I disagree. If $a->{b} doesn't exist, we know that $a->{b}{c} cannot exist, and perl could know too. The fact that such reads autovivify are really only due to a quirk in the implementation, and not deducible from a general rule like "autovivification happens only when it needs to".

Replies are listed 'Best First'.
Re^5: When DOESN'T "Use of uninitialized value" show up?
by ikegami (Patriarch) on Dec 17, 2011 at 09:12 UTC

    And that's the part where I disagree. If $a->{b} doesn't exist, we know that $a->{b}{c} cannot exist,

    But he isn't checking if $a->{b} exists, so it's possible that $a->{b}{c} can exist. Perl is being asked if $a->{b}{c} exists, and it's being done a few steps after autovivifying $a->{b}.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found