Just as an adjunct to what you have there, length returns FALSE for a zero-length EXPR and also an undefined EXPR. The latter behaviour was introduced in 5.12.0 (perl5120delta: Other potentially incompatible changes).
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.
— Ken
In reply to Re^2: methods for dealing with zero '0' as a string or char
by kcott
in thread methods for dealing with zero '0' as a string or char
by boleary
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |