Is this what you want or am I missing something?
Yes, it does exactly what I want.
Now we have 3 solutions to compare:
Yours is perhaps the most natural - a recursive solution for a recursive problem.
japhy's solution neatly replaces recursion by iteration and enables the use of File::Find::find.
Mine , deprecated because based on string eval, uses the information extracted with File::Find::find directly.
All have similar complexity. Performance will probably be dominated by the disk access operations, not by the algorithm used.
Rudif