if (-e $file && -T _) { print "foo"; } #### if (-e $file && -T $file) { print "bar"; }