True, it returns ' ' for false, but ' ' is an even more interesting number than 0.
About this quote
- What does it mean?
- False is represented by an empty string, which is even more intriguing than zero.
- In plain terms
- Perl uses an empty string for false, a quirky choice.
- What can you take from it?
- Be aware of language‑specific false values.
Where it applies
Putting it to work
Questions to consider
- How does Perl's false value affect code?
- When might this be problematic?
Another view
Empty strings can also be truthy in other contexts.
More from Larry Wall
I'm sure a mathematician would claim that 0 and 1 are both very interesting numbers. :-)
Permalink to quote #89 Any false value is gonna be fairly boring in Perl, mathematicians notwithstanding.
Permalink to quote #91 I think you didn't get a reply because you used the terms 'correct' and 'proper', neither of which has much meaning in Perl culture. :-)
Permalink to quote #88
Related quotes
And don't tell me there isn't one bit of difference between null and space, because that's exactly how much difference there is. :-)
Larry WallLarry Wall quote #2 > (It's sorta like sed, but not. It's sorta like awk, but not. etc.) Guilty as charged. Perl is happily ugly, and happily derivative.
Larry WallLarry Wall quote #51 We toast the Lisp programmer who pens his thoughts within nests of parentheses.
Alan PerlisAlan Perlis quote #2