[Canberra-pm] Writing output to a web browser like clearing a buffer

pa_bryan@yahoo.co.uk pa_bryan at yahoo.co.uk
Fri Jun 24 02:44:22 PDT 2005


On Fri, Jun 24, 2005 at 04:58:49PM +1000, John.Hockaday at ga.gov.au wrote:
> Hi All,
> 
> I'm using the PERL CGI module to generate output from a submitted web form.
> The content of the web page is very lengthy.  It also takes a while for the
> PERL script to run because it is doing a lot of processing to get the output.
> I have tried emptying the buffer with the "$| = 1;" command.  If I run the
> script on the command line the output prints without buffering and is OK.  If
> I run the script from my apache web browser the header prints but then
> nothing prints until the whole script is processed.  I expect that users will
> think that the process is not running and stop it or worse still try to run
> it again.
> 
> Is there a way that I can clear the buffer to print to the browser without
> having to wait for the whole page to be generated?  I tried CGI "push" and
> "-nph" options but these just gave me a "malformed header" error in by apache
> error log file.

$| = 1 turns off output buffering. Maybe it's as simple as that?

Cheers,
Paul.



More information about the Canberra-pm mailing list