RockE has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks I have this code to search for specific directories, I'd like to speed up the search by getting file::find when it hits one of these directories to stop and move on to other directories searching for the pattern, under the pattern matched directory can be a whole lot of other sub directories but none matching what I'm looking for, file::find is looking at all of these hence the slow search results I'm getting.
I'm unable to get installed other modules like file:find:prune etc#!/usr/bin/perl # dirpath use strict; use warnings; use File::Find; #*****************Path Variables********************** our $testpath = 'C:\\Temp\\'; #******************************************************* find(\&dir_names, $testpath); sub dir_names { return unless -d; print "$File::Find::dir/$_\n" if /[IPD]\d{8}$/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Limiting file:find depth question
by GrandFather (Saint) on Nov 14, 2013 at 02:14 UTC | |
by RockE (Novice) on Nov 14, 2013 at 05:46 UTC | |
by RockE (Novice) on Nov 14, 2013 at 06:08 UTC | |
|
Re: Limiting file:find depth question
by kschwab (Vicar) on Nov 14, 2013 at 02:40 UTC | |
by Anonymous Monk on Nov 14, 2013 at 08:57 UTC | |
by RockE (Novice) on Nov 14, 2013 at 06:09 UTC | |
by kschwab (Vicar) on Nov 14, 2013 at 06:43 UTC | |
|
Re: Limiting file:find depth question
by Anonymous Monk on Nov 14, 2013 at 03:36 UTC |