Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: hash undef?

by zer (Deacon)
on Nov 15, 2007 at 14:23 UTC ( #650981=note: print w/replies, xml ) Need Help??


in reply to hash undef?

 if (exists $time{$recordNumber}) This will tell you if it actually exists rather than whether it holds an undef or not. Defined will return false if the value contains an undef or if it just doesnt exist.

Update: Thank you Mr. Anony. I had said that Defined returns undef, which isnt accurate and even contradicts the use of the function.

Replies are listed 'Best First'.
Re^2: hash undef?
by Anonymous Monk on Nov 15, 2007 at 15:11 UTC
    defined returns a boolean false (an empty string), not undef, if the value it is testing is not defined:

    perl -wMstrict -e "print 'defined returns defined' if defined defined undef" defined returns defined

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2023-09-25 18:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?