Conditional statements invariably test whether something is true or not. Perl thinks something is true if it doesn't evaluate to zero (0), an empty string (""), or undefined.
42 # true 0 # false "0" # false, because perl switches it to a number when it # needs to "wibble" # true $new_variable # false (if we haven't set it to anything, it's # undefined) |
The Camel discusses Perl's idea of truth on pages 20-21, including some odd cases.