http://qs321.pair.com?node_id=427902


in reply to Re: Behavior of File::Find's preprocess and glob
in thread Behavior of File::Find's preprocess and glob

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..