#!/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); }
In reply to Re: Browser Timeout
by Rhandom
in thread Browser Timeout
by Jonas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |