perl -e '$foo = 0; $foo==0 ? print "foo is zero" : print "foo is non-zero";' Output: foo is zero