Your skill will accomplish what the force of many cannot |
|
PerlMonks |
File::Find preprocessby pvaldes (Chaplain) |
on Jan 08, 2018 at 16:20 UTC ( [id://1206910]=perlquestion: print w/replies, xml ) | Need Help?? |
pvaldes has asked for the wisdom of the Perl Monks concerning the following question: Lets suppose that we have a dir A with two subdirs B and C each one having two files on it named: a1, a2, b1, b2, and, c1, c2. I'm using File::Find to traverse the entire tree My goal is to explore the preprocess and postprocess options in the function find from this module. My dumb function should print "hi" each time I enter in a dir, "bye" each time I finish with this directory and "file! " for each file present in the dir:
I expect having printed three "hi", three "bye" and six "file!" in this order: hi file! file! bye (repeated three times); I obtain instead just "file! hi", and the same if I change "exit 0;" by "exit 1;" Can somebody please explain why?
Back to
Seekers of Perl Wisdom
|
|