You could
die if $max_hits--; in your
wanted(). You only have to wrap the
find() in an
eval to catch the exception so that it doesn't actually abort the script. I'm not sure you're not making a dangerous assumption in that the files you want will be there by the time you die, though.
Makeshifts last the longest.