in reply to $File::Find::prune

This is just an error in your logic, basically. What you want is probably:
if ($File::Find::name =~ m!^/some_dir/sub_dir!) { print "skipping $dir\n'; $File::Find::prune = 1; return; }
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.

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
    $File::Find::name was it :) thanks to yourself and Tyke who tried to point me in the right direction though I still managed to keep looking at $File::Find::dir and scratch my head wondering :) . Cheers.