You're going to have to do a depth first search if you want to rename directories and their sub-directories, and File::Find::Rule doesn't seem to have an option for that. Though, I think you could sort the results by the number of directory separators (from greatest to least) -- yeah, that oughta work.