First a few non-perly fundmentals:
in reply to Is CGI.pm my best choice?
The following happens after browser has made a connection.
- The Apache TimeOut directive controls when the webserver will give up and close connection when waiting to recieve data (from browser) or send data (static or cgi generated data). The TimeOut default in my version of Apache is 300 seconds.
- The human controlling the browser can also kill connection via STOP button or killing browser.
... It works fine when it is a small report that only takes 5 minutes or less, but if it has to parse a large amount of traffic over many log files, the script timesout before it is complete.
Looks like you are hitting the 300 second limit. So you can either up the TimeOut value (don't forget to reboot apache :) ) or use a different approach like some the suggestions already given. I beleive that it is never a good idea to keep user waiting. So what I have done with these types of long running 'Admin' type functions is to either create cron driven scripts that produce static report pages, or scripts that munge data down to a form that can be quickly transformed ie data->XML->XSLT->HTML. There is also a high bred method that I use when info is needed realtime up to the minute; scheduled preprocessing, cgi only recent data.
mitd-Made in the Dark
'Interactive! Paper tape is interactive!
If you don't believe me I can show
you my paper cut scars!'