use strict; use warnings; my $x; if (defined $x) { # do nothing } else { print "\$x is not defined\n" }