in reply to How to determine whether a dir entry is a directory?

you can simply use the -f and -d flags to determine if something is a file or a directory, like so:
my $fileA = "./something"; my $fileB = "./something/else.txt"; if(-d $fileA and -f $fileB) { ... }
This will check to see if $fileA refers to a directory and if $fileB refers to a file...