greenFox has asked for the wisdom of the Perl Monks concerning the following question:
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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $File::Find::prune
by btrott (Parson) on Mar 09, 2001 at 13:16 UTC | |
by greenFox (Vicar) on Mar 09, 2001 at 13:43 UTC | |
|
Re: $File::Find::prune
by arhuman (Vicar) on Mar 09, 2001 at 12:58 UTC | |
by Tyke (Pilgrim) on Mar 09, 2001 at 13:16 UTC |