in reply to Why is preprocess a no-op when follow is true for File::Find?

That module is frustratingly under-commented. And the identifier and sub names could use some work.

After a glance around, I don't see any condition that prevents pre-processing from occuring. $pre_process is called on the filenames if it's defined, and nothing relating to the follow option (copied to a $full_check) or the follow_fast option (copied to a $follow) ever change that.

Have you tried it to see that follow really does preclude pre-process? (I haven't.)

Replies are listed 'Best First'.
Re^2: Why is preprocess a no-op when follow is true for File::Find?
by bounsy (Acolyte) on Dec 03, 2010 at 17:54 UTC

    I have tried to use follow with preprocess. They don't work together.

    I looked through the source code for File::Find. If follow is true, the code calls _find_dir_symlink. If follow is false, the code calls _find_dir. Only _find_dir ever calls the preprocess function.

    Why doesn't _find_dir_symlink call it? There are no comments in the code or documentation to describe why this is so. There is only the statement from the doc stating that the two are not compatible.

    I just noticed from the docs that postprocess is likewise a no-op when follow is turned on. Again, it is only called from _find_dir in the code.