Every time I write a perl script I have to pause to remember how Perl handles true and false. It seems Nathan Torkington answered the question years ago in this article from the Perl Journal. Truth is relatively simple when put in his terms:
- only scalars can be true/false (ie no lists)
- undef is false
- “” is false
- 0 is false
- 0.0 is false
- “0″ is false
- all else is true
This means negative numbers are true.