Actually, if asked to do this myself, I would use plain old GNU find. [...] but neither have significant advantages over the find utility for this particular question.

Actually, there are several advantages of doing this type of thing with Perl instead of the regular "find" command. First, you can do it all in a single process. Second, you don't have to worry whether your "find" and "xargs" support "-print0" and "-0" nor remember to use them and yet your Perl code will not do dangerous things in the face of files with whitespace in their names. Third, Perl code is easier to extend in interesting ways when the desire hits.

But my point about find2perl is that you can use it to generate the first version of the script and then just update that script in the future. Or use it to generate a template then edit it so that it takes the variable bits from the command line or even prompts for them (this is what I meant about being easy to extend in interesting ways).

        - tye (but my friends call me "Tye")

In reply to (tye)Re2: Pruning of file with timestamps filenames by tye
in thread Pruning of file with timestamps filenames by DanNeedles

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.