in reply to Re: Tutorial::What is true and false?
in thread Tutorial::What is true and false?
I disagree with you on this. undef is a special false value in a Boolean context. The reason I say this is because in a Boolean context, undef doesn't get promoted to the empty string or zero like it does when used most other places.
So undef isn't a numeric value nor a string value which is why you can't detect undef by comparing it to a string or a number. But there are other values that have these same problems (references being the most obvious). So, yes, we should keep undef in a different conectual box than strings and numbers, as we should references. But in the case of Boolean logic, undef is a distinct value in my book.
And a discussion of "what is false" should mention it explicitly.
- tye (but my friends call me "Tye")
|
|---|