#!/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"; # don't need to hide output anymore print "All done\n"; exit; sub do_something_heinous { sleep(6 * 60); }