Try a recursive routine,
File::Find does that job quite well...
Update: I once provided a simple recursive routine that does just that,
Recursion example (Directory sizing on the side), also check
Fastolfes reply.
Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.