in reply to Browser Timeout

There is another way. (Probably easier to). Apache and the browser won't time out as long as data is being sent. So send some data...

#!/usr/bin/perl $| = 1; # thousands of ways to do this print "Content-type: text/html\n\n"; ### set up an alarm my $timeout = 4*60; # apache normally times out after 5 min print "<!--\n"; # hide output $SIG{ALRM} = sub{ print ".\n"; alarm($timeout); }; # the timeout will send something to the browser every # now and then to keep it from timing out alarm($timeout); &do_something_heinous(); alarm(0); print "-->\n"; # don't need to hide output anymore print "All done\n"; exit; sub do_something_heinous { sleep(6 * 60); }


My company actually has a module that we can use to wrap around this. It works great. (Actually, I typed this code in from memory -- our servers are down from a storm -- hope it compiles, but the idea should be intact).

my @a=qw(random brilliant braindead); print $a[rand(@a)];