> Interestingly, given the general discussion here, the FALSE value returned for a zero-length EXPR is 0, while the FALSE value returned for an undefined EXPR is undef.
Some operators in Perl return an internal magic boolean value, which is !!0 for FALSE and !!1 for TRUE.
length is not one of them, it returns values which are interpreted as FALSE or TRUE, returning undef for undef is very consistent in my eyes.
Though one probably could argue that warnings uninitialized should trow a warning here, I'm a bit confused in this matter.
I remember that tobyink started a discussion once that warnings uninitialized leads to inconsistent behaviour.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re^3: methods for dealing with zero '0' as a string or char
by LanX
in thread methods for dealing with zero '0' as a string or char
by boleary
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |