if ( defined $foo and $foo ne "" ) { print "da is was\n" } else { print "da is nix\n" }