in reply to distributed computing

Many people do this type of work with POE. The idea is that one POE process receives requests or time polls a resource (like the file system). Then it can do what it likes, in your case handing off the work to subservient servers. It's good at networked interactions like the ones you described.

See the perl.com articles: http://perl.com/pub/a/2004/07/02/poeintro.html and its followup http://perl.com/pub/a/2004/07/22/poe.html.

To find file sizes, use stat. That takes time, so you might want to cache results in some way.

Phil