$ perl -e '$x = 0; print "failed\n" unless $x and length($x)' failed $ #### $ perl -e '$x=0; $ print "failed\n" unless defined $x and length($x)' $