in reply to $File::Find::prune
In other words, test $File::Find::name, not $File::Find::dir. When process gets called, dir holds the name of the *containing* directory. So when process gets called for the entry "/some_dir/sub_dir", dir is "/some_dir". You're expecting it to be "/some_dir/sub_dir", but it's not that until you've actually descended into "sub_dir". So you're skipping all the entries below "sub_dir" but not descending into "sub_dir" itself.if ($File::Find::name =~ m!^/some_dir/sub_dir!) { print "skipping $dir\n'; $File::Find::prune = 1; return; }
Make sense?
By the way, "$dir/$_" is just $File::Find::name. I think.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: $File::Find::prune
by greenFox (Vicar) on Mar 09, 2001 at 13:43 UTC |