in reply to As usual
in thread Recursive directory scanning

I suspect the reason for the deep recursion is that you don't filter out '.' and '..'. When you recurse on the contents of a directory, you recurse on the contents of its "subdirectory" '.' (and its "subdirectory" '.' ...).

As merlyn also pointed out, since you're not using chdir, you need to specify the full path to each file in the file test and the opendir().

You already have the solution, which is File::Find. :)