I wrote return if... and not next if ... for a reason.

Since you are in a subroutine and not directly in a loop, next will jump to the next iteration of your caller's loop, and warns about Exiting subroutine via next at ... - don't you get such warnings? Since you don't know how File::Find works internally, that might cause very nasty behaviour.

By the way I don't find that excessive use of newlines improves readability - on the contrary, you have to scroll more to see a relevant part of the code.


In reply to Re^5: File::Find finding . and .. by moritz
in thread File::Find finding . and .. by transiency

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