in reply to How to avoid browser time out?

Just print something back to the browser periodically while your script is running. Anything will do, even a single character. If you don't need feedback during the computation, use a single space so it will not occupy real estate in the browser window.

... code $| = 1; # set autoflush print "Content-type: text/html\n\n"; # simulate long running computation: for (1..3600){ sleep 1; # or do some processing # sends a single space to browser every 10 seconds unless ($_ % 10){ print ' ' } } ... more code

Update: Set autoflush before doing this.