I expect I have completely misunderstood the purpose of $File::Find::prune, here is my code-
my $dir = '/some_dir';
find (\&process, $dir);
sub process {
my $dir = $File::Find::dir;
if ($dir =~ /^\/some_dir\/sub_dir/){
print "skipping $dir\n";
$File::Find::prune = 1;
return;
}
print "$dir/$_\n";
}
what I expected to happen is that I would get one "skipping..." message and that find would not descend below sub_dir. This is not what happens, instead I get lots of "skipping..." messages. What is $File::Find::prune supposed to do and how do I do what I want to.
Thanks.