$ perl -le 'print "T" if ((print "foo" or print "bar") and (not (print "foo" and print "bar"))' foo foo bar