Nice code. I saw something in your code that I was doing, and lately converted. These lines:

#use default directory if argument not set on command line find(\&fileop, $opts{'directory'}) unless @ARGV; find(\&fileop, @ARGV) if @ARGV;
Your use of if and unless are creating a more compact form of if (...){} else {} for calling &find. I love statement modifiers, but I now use the following form:
#use default directory if argument not set on command line find(\&fileop, @ARGV ? @ARGV : $opts{'directory'});
That way, with a true if/else variant, I never screw up the logic and inadvertently create overlapping conditions, which were difficult to debug.

Yes, Aristotle said the same thing, but the key, I think, is not the needless redundancy of the code, but the danger of creating those overlapping conditions.


In reply to Re: How would you go about it? by pbeckingham
in thread How would you go about it? by pcassell

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.