in reply to How to open redirected url while running foolwing code in background
Also see Watching Long Processes Through CGI for an implementation of the technique described by almut