in reply to CGI daily 'cleanup' task

This discussion has been brought up before on this site with discussions focusing on the merits of separate 'clean-up' scripts running as crontab or scheduler tasks - See unlinking old files for one such discussion.

However, depending upon your CGI::Application application, you may want to take advantage of the teardown method which is specifically designed for final clean-up tasks - This method is described in my review of the CGI::Application module here. It may be worth investigating the usage of this method in combination with a persistent information store like Cache::Cache or locking mechanism for implementation of such scheduled clean-up tasks.