#Main File use File::Temp; my ($fh, $filename) = tempfile( DIR => '/tmp'); my ($hfh, $results) = tempfile( DIR => '/html'); print redirect("holding.cgi?file=$filename&html=$results"); do { # process record print $fh $num_records,"\n" unless ($num_processed++ % 1000); } while($records_not_processed); # write results to $hfh # ...or just results.htm... # ...if you haven't got multiple users / datasets etc. unlink $filename; #Holding.cgi my $filename=param('file'); my $html=param('html'); if (-e $filename) { open FILE $filename; # read in last number # print some HTML... # ...that's got a META refresh in... # ...that points back to ourself close FILE; } else {print redirect($html);}