There's a few bits of your sample code that don't seem right: Your test sub could be written more simply:
sub get_good_int { next if /^unknown/; print "My filename is: $_\n"; }
Something closer to being useful might be this:
use File::Find; use File::Basename; find (\get_good_int, '/nfs/export/netflow/intermediate'); sub get_good_int { next if /^unknown/; # If the directory path includes this type of dir if ($File::Find::dir =~ m#/questionable-\d{6}-\d{6}#) { myfunc1($_); } # If it contains this other type of dir elsif ($File::Find::dir =~ m#/\d{6}-\d{6}#) { myfunc2($_); } }
buckaduck

In reply to Re: File::Find Question by buckaduck
in thread File::Find Question by Tuna

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.