Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 cooling their heels in the Monastery: (3)
As of 2022-08-17 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?