my $file = "/etc/passwd"; my $directory = "/etc"; if (-f $file) { print "file !!" } if (-d $directory) { print "directory !!" }