if (-d $filename) { print "directory\n"; } else { print "other\n"; }