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.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"; }
In reply to $File::Find::prune by greenFox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |