$rule->new->directory->name( @dirExclusionsQR )->prune->discard
->prune means not to descend into that directory. Your fist match is ., so File::Find::Rule isn't even descending past the base directory. Second, note that ->name matches on the basename only, so the extra slashes you've got in there won't match. This works for me, hopefully it's what you're looking for:
use warnings; use strict; use File::Find::Rule; my $tagLocation = '...'; my @dirExclusions = qw/ LOG cache AVCHD /; my $rule = File::Find::Rule->new; $rule->or( $rule->new->directory->name( @dirExclusions )->prune->discard, $rule->new->directory ); my @fileList = $rule->in($tagLocation);
In reply to Re: Formatting Regex for File::Find::Rule
by haukex
in thread Formatting Regex for File::Find::Rule
by springgem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |