u914 has asked for the wisdom of the Perl Monks concerning the following question:
i've poked around here, using the Search and SuperSearch, and the closest i've come up with is this.
What i'm really trying to do is to find a set of files, and concatenate them all together into one big file, in time-order.
File::Find seems to be the right thing, and it's apparently wizardly and flexible beyond my means... so i tried out find2perl, but recieved this response:find . -name threads.html -maxdepth 3 -mindepth 3
find2perl find . -name threads.html -maxdepth 3 -mindepth 3 Unrecognized switch: -maxdepth
The depth is important, as there are "threads.html" files both in the 2 and 4 sublevels of the current directory, and they must not be included... however, sometimes this script will be operating on one of those subdirectories, and will still need to collect files from 3 levels below the current working directory.
find2perl tells me that this is what i want, minus the -maxdepth and -mindepth switches:
File::Find::find({wanted => \&wanted}, 'find', '.'); sub wanted { /^threads\.html\z/s; }
In any case, thanks for reading this!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: find2perl with File::Find and -maxdepth
by samtregar (Abbot) on Jun 02, 2002 at 06:08 UTC | |
|
(tye)Re: find2perl with File::Find and -maxdepth
by tye (Sage) on Jun 02, 2002 at 06:30 UTC | |
by u914 (Pilgrim) on Jun 02, 2002 at 15:41 UTC | |
by tye (Sage) on Jun 03, 2002 at 00:50 UTC | |
|
Re: find2perl with File::Find and -maxdepth
by u914 (Pilgrim) on Jun 02, 2002 at 05:48 UTC |