use File::Find::Rule; my $rule = File::Find::Rule->new; $rule->any( $rule->new ->directory ->name('winnt') ->prune ->discard, $rule->new ); while ( my $file = $rule->match ) { .. }
This module provides an alternate interface to the File::Find module and the code above works by creating a rule set ($rule->any) that matches all files ($rule->new) filtered by a second rule that trims the file path and discards any within the 'winnt' directory ($rule->new->directory->name('winnt')->prune->discard). All files located via this ruleset can then be iterated through within the $rule->match while-loop.
A very nifty module ...
In reply to Re: How do you exclude certain folder or directories from a search
by rob_au
in thread How do you exclude certain folder or directories from a search
by kirk123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |