how to flush STDOUT before end of script

Echo (echo@echo.cica.fr)
Thu, 30 Jan 1997 02:58:31 +0100 (MET)

Date: Thu, 30 Jan 1997 02:58:31 +0100 (MET)
From: Echo <echo@echo.cica.fr>
To: fastcgi-developers@OpenMarket.com
Subject: how to flush STDOUT before end of script 
Message-Id: <Pine.LNX.3.95.970130024746.3272A-100000@echo.cica.fr>



I installed fcgi with apache 1.2b6 with perl ..
 but I'am quite dispointed because apache wait for the end of the script
execution before sending the whole page. 
In this cas I see almost nodifference with a normal cgi script.

How to force apache to print HTML code to the client in "real time" ?

Thanks for any help.
 Chris.



for instance :

while(FCGI::Accept() >=0)
{

$|=1;
print "fisrt";
sleep 10;
print "second";

}

I would like to see the "first" 10 seconds before the "second";