Skip to content
quotesby

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

  • debugging
  • learning Perl

Putting it to work

  • test for definedness
  • avoid implicit conversion

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

  1. I'm sure a mathematician would claim that 0 and 1 are both very interesting numbers. :-)

    Permalink to quote #89
  2. Any false value is gonna be fairly boring in Perl, mathematicians notwithstanding.

    Permalink to quote #91
  3. 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

  1. 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
  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
  3. We toast the Lisp programmer who pens his thoughts within nests of parentheses.

    Alan PerlisAlan Perlis quote #2