if (-e $file){ print "File exists\n"; } if (-f $file){ print "File is plain\n"; }