in reply to skip directories when using File::Find

File::Find has a variable $File::Find::prune. When it's true, F::F won't descend into any subdirectories of the current directory.

You might also want to monitor $File::Find::dir, if you want to descend inside your $restricted directories


TGI says moo

  • Comment on Re: skip directories when using File::Find

Replies are listed 'Best First'.
Re: Re: skip directories when using File::Find
by agent00013 (Pilgrim) on Jun 28, 2001 at 19:33 UTC
    Thanks to your response and those of blakem, and DrZaius, I was able to fix it up. Thanx! (and for those too lazy to follow the link to the $File::Find::prune node, here's the code I got from it...
    if ($File::Find::name =~ m!^/some_dir/sub_dir!) { print "skipping $dir\n'; $File::Find::prune = 1; return; }