I have a set of directories in an array as
chdir /tmp;
my @dir=("test" "abc" "def")
I am looking for a way using File::Find::Rule to find all files in /tmp recursively, but excluding files from the ones in @dir.
I could get all files from @dir by
my $rule = File::Find::Rule->new;
$rule->file;
my @files = $rule->in( @dir );
But I cannot negate the condition, that is to exclude @dir. I was trying
chdir /tmp;
@files = File::Find::Rule->new
->file()
->name(@dir)
->prune
->in( "." );
but no output.
The documentation lists this example:
You could probalby do the same thing:
Consider this example:
Here's the code:
And now I run this: