http://www.perlmonks.org?node_id=1056571


in reply to Analyse file system - files, sizes, contents, access, etc.

Here's something I posted awhile back - it doesn't do everything you have in mind, but it covers a decent subset, and maybe you could use it as a starting point for doing what you really want...

Get useful info about a directory tree