hello everyone!

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.

To that end, i need my script to do something like:
find . -name threads.html -maxdepth 3 -mindepth 3
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:
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; }

and that even makes sense to me, except that i cannot figure out how to modify it to emulate the -max|mindepth values.

In any case, thanks for reading this!


In reply to find2perl with File::Find and -maxdepth by u914

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.