my $fileA = "./something"; my $fileB = "./something/else.txt"; if(-d $fileA and -f $fileB) { ... }