in reply to
Re: A looping question
in thread A looping question
First, remove that "no warning" clause, when you develop, warnings are a guide to things that may be wrong, or are wrong. As posted, the program don't compile for a strict violation, you should declare $basedir (and while at it, there's no need to declare Wanted both on the top and bottom of the program.
Second, you check twice on the return value of "find" which goes contrary to File::Find's purpose, which is to loop over, recursively, a file tree and perform a certain action on each file/folder. Your logic should go inside the Wanted sub, rather than on an outer loop.
"Principle of Least Astonishment: Any language that doesn’t occasionally surprise the novice will pay for it by continually surprising the expert..