Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Automagic Array to Hash Conversion? Pseudo-Hash Explosion

by strat (Canon)
on May 14, 2002 at 15:59 UTC ( [id://166473]=note: print w/replies, xml ) Need Help??


in reply to Automagic Array to Hash Conversion? Pseudo-Hash Explosion

Your problem might be auto-vivification. With defined, you just check if a value of a hash is defined, not if it is existing. (And the value of a hash may be existing but undef without problems).

Better use something like:

if( exists($foo->{$_} and exists($foo->{$_}->{bar} ) { ... }

Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found