I note, for those who might come across this node (and this is not meant to count as a rebuff to footpad -- I think it's good to think about why your code doesn't work, you usually (always?) learn something!) that if you want to exclude directories from being traversed by File::Find, you can set $File::Find::prune to 1 if the current directory matches the exclusion pattern.

Below is untested ...

# nifty trick -- make a hash to ease the lookup in the findit sub my %excludeit; # now set the keys of the hash # (== the members of your excluded directories array) # to have values of 1 @excludeit {@exclude_dirs} = (1) x @exclude_dirs; # this would be the subroutine used by File::Find sub findit { $File::Find::prune = 1 if $excludeit{$_}; # .. }

Philosophy can be made out of anything. Or less -- Jerry A. Fodor


In reply to Re: Problems creating sub's by arturo
in thread Problems creating sub's by footpad

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.