You have (at least) two choices:
- Don't use File::Find on the times when you don't want to recurse. Globbing or directory handles are pretty easy to wrangle.
- Turn on $File::Find::prune = 1; each time you enter the subroutine and the value of $File::Find::name is not your top-level directory.
This tells File::Find that this subdirectory should not be entered. It'll be ignored
for files.
-- Randal L. Schwartz, Perl hacker