I think it depends on whether your 'few' directories
are full pathnames or all '.CVS' directories as above.
Or some other requirement we don't know about.
Here's something that includes the first two:
use File::Find;
my @abs_dirs=qw(/dont/go/here /stay/out);
my @all_dirs=qw(.CVS .stayout);
my %abs_dirs;
@abs_dirs{@abs_dirs}=();
my %all_dirs;
@all_dirs{@all_dirs}=()
find (sub {
$File::Find::prune=1, return if -d and (exists $abs_dirs{$File::Find:
+:name} or exists $all_dirs{$_});
# Process other files, dirs
#
}, ".");
Update: runrigs fix (see below) was incorporated