Good catch, I got a lot of this code from an example in a Tutorial here (
Beginner's Guide to File::Find), and the case there had both a maxdepth and a mindepth, which I have gotten rid of, I must have missed this line when checking the results of my search and replace.