File::Find assumes that you don't alter the $_ variable. If you do then make sure you return it to its original value before exiting your function.