in reply to Ensuring the user doesn't have to wait for a CGI to finish

You have to add the following line at the beginning of your script:
$|=1;
It is setting printing into direct mode (turning buffer off), so perl will flush out everything in realtime.

--
tune