in reply to Keep track of running CGI script

I would: When database is updating, it sets a percentage mark - eg, 20,000 records, % mark is 200 ($percent_mark = int($total/100);

create a temp file. Every $percent_mark records, append a character to the file.

Return a marker for the temp file in the cgi response, so the JavaScript call points to correct file:

<SCRIPT LANGUAGE="JavaScript> setTimeout(30000,"top.display_frame.location.href= 'counter.cgi?tmpfil +e=temp_file_name';"); </SCRIPT>
Then, when you call the counter.cgi file, percentage complete is:
my $percent_complete = stat(temp_file_name)[7];
Return this in your display frame along with JS above.

Amend to suit - only my .02

cLive ;-)

PS - if it really takes an hour, you might want to set a cookie and tell them to check back later - and use the cookie to identify them in the script.