Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I want to exclude the one sub directory using File::Find
If I am not able to skip that sub directory, I can not come out from that sub directory.
Because system automatically generates each time new files in to that sub directory
So I need to skip the sub directory.
thank you
jhon
  • Comment on File::Find should not go in to the spcified directories

Replies are listed 'Best First'.
Re: File::Find should not go in to the spcified directories
by ikegami (Patriarch) on Mar 30, 2009 at 13:11 UTC
    You can use the prune feature to skip a subtree.
    find(sub { if (...[ is dir to skip ]...) { $File::Find::prune = 1; return; } ... }, $dir);