if (-d $fileFound) { # it's a directory } else { # it's *not* a directory }