Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: defined defined -- Bug or "Feature"?

by Anonymous Monk
on Dec 24, 2015 at 10:23 UTC ( #1151112=note: print w/replies, xml ) Need Help??


in reply to defined defined -- Bug or "Feature"?

perlsyn:

Truth and Falsehood

The number 0, the strings '0' and "" , the empty list (), and undef are all false in a boolean context. All other values are true. Negation of a true value by ! or not returns a special false value. When evaluated as a string it is treated as "", but as a number, it is treated as 0. Most Perl operators that return true or false behave this way.

I'm assuming this is the missing piece of documentation that explains why defined always returns a defined value.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2020-01-21 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?