in reply to Long running CGI script

Or maybe have a look at CGI::Ajax. It gives a fairly straightforward mechanism of polling for updated info.