in reply to Re: Force Browser to Render Partial Page
in thread Force Browser to Render Partial Page

When STDOUT is redirected to the browswer with CGI is it still buffered? I rarely see CGI scripts starting like that, which is why I ask.
  • Comment on Re: Re: Force Browser to Render Partial Page

Replies are listed 'Best First'.
Re: Re: Re: Force Browser to Render Partial Page
by bobn (Chaplain) on Aug 28, 2003 at 12:50 UTC

    Consider this code:

    #!/usr/bin/perl -w $|++; use CGI; $q = new CGI; print $q->header(), $q->start_html(), "before wait<br /><br/>"; sleep 5; print "after wait\n\n\n", $q->end_html;

    As shown, my browser (Mozilla 1.4) renders "before wait", then several seconds later, "after wait" appears.

    If I comment out the $|++; then all of it shows up in the browser at the same time.

    --Bob Niederman, http://bob-n.com

    All code given here is UNTESTED unless otherwise stated.