in reply to using File::Find for reading files in order

If you had warnings enabled then you would have received the message Exiting subroutine via next at YOUR_PROGRAM line N.

You need to use return to exit from a subroutine instead.