in reply to File:Find pattern match question

Perhaps $File::Find::prune will work:

sub dir_names { # Skip over everything that is not a directory. Note that # chdir means we can use -X file tests on default $_. -d or return; # Skip over directories that don't match required pattern. # Match against $_ instead of entire directory path. /^[IPD]\d{8}$/ or return; print "$File::Find::name\n"; # Do not recurse below current directory. $File::Find::prune = 1; }