Boolean values: TRUE and FALSE

if ($z) {
    # $z is true

The FALSE values:

0  0.0  00000  0e+10

All other values, such as the following are TRUE:


In many cases the separation must be between "real" values and undefined values. For that you can use the defined function:

if (defined $x) {
    # $x is defined (not undef)