Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
If you do filter our directory names in the "wanted" function then you'll prevent File::Find from recursing into those directories.
Did you mean filter out the directory names in "preprocess" (as opposed to the "wanted" function) - That is why the recursion stopped! I see..

.. it still doesn't answer the question as to why the "preprocess" glob of *.pl *.txt in my earlier snippet returns the directory name.. but thanks, I do see now how I was blocking File::Find from recursing by removing directories from the what "preprocess"'s return list ..

Although your code rework works perfectly, the same result can be gotten with just doing directory and file-extension pattern matching in "wanted".. without bothering with a "preprocess" call ... so for example what if there were several hundred subdirectories which I knew did not contain *.pl or *.txt - I was trying to find a way that "wanted" could skip the needless processing/recursion..

In reply to Re^2: Behavior of File::Find's preprocess and glob by hsinclai
in thread Behavior of File::Find's preprocess and glob by hsinclai

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2022-05-27 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (94 votes). Check out past polls.

    Notices?