You are right about Perl buffering by default, but it only buffers until it
hits a newline. In the example I ensure that a newline is present. I am
setting optEarlyHttpHeader in the httpd.conf file not in the script. Thanks
Anyway. Somebody help! :-)

-----Original Message-----
From: Ed Grimm [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 21, 2001 11:02 PM
To: Webb, Trey
Cc: '[EMAIL PROTECTED]'
Subject: RE: Embperl and buffered output


You haven't set $|=1.  Perl itself is therefore buffering.  According to
the embperl docs, if you set optEarlyHttpHeader (by bit value; it
doesn't affect anything if set after the page starts processing) and you
set $|=1 on the page (well, embperl docs assume you know perl, so don't
mention this, but...), you should (keyword should) get the results you
desire.  I've not verified this, as I have no desire for this
functionality.

Ed

On Wed, 21 Nov 2001, Webb, Trey wrote:

> I think you mean that HTTP is not a 'push' technology, because in fact
your
> browser is pulling the information from the web-server. In any event I am
> well aware of how it works, but that has nothing to do with my question.
For
> example there are CGI scripts that allow users to enter an IP address in a
> field and then perform traceroutes or pings. The browser renders each line
> as it is returned because stdout for that script is directed to the HTTP
> stream. Then when finished the stream is closed and the page is done. I
> would like to be able to do this with embperl, but it apparently holds
> everthing until the stream is close d and then sends the results to the
> browser, by default. Thats where those two variables come in, or at least
> one of them, but I can't seem to make it work.
> 
> -----Original Message-----
> From: alan milligan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 21, 2001 10:39 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Embperl and buffered output
> 
> 
> 1.  HTTP is not a 'pull' related technology.  the client must invoke each 
> data request.  TO do what you want to do, you need streaming.
> 
> 2.  Of course nothing is going to happen until your sub-process finishes -

> it is only then that process flow is returned to the main Embperl routine
to
> 
> complete writing the output to the request.
> 
> 
> >From: "Webb, Trey" <[EMAIL PROTECTED]>
> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> >Subject: Embperl and buffered output
> >Date: Wed, 21 Nov 2001 20:23:13 -0500
> >MIME-Version: 1.0
> >Received: from [64.125.133.20] by hotmail.com (3.2) with ESMTP id 
> >MHotMailBDC5A21B00934004325E407D8514115C0; Wed, 21 Nov 2001 17:38:35
-0800
> >Received: (qmail 15183 invoked by uid 500); 22 Nov 2001 01:38:26 -0000
> >Received: (qmail 8055 invoked from network); 22 Nov 2001 01:23:06 -0000
> >From embperl-return-3165-alan_milligan Wed, 21 Nov 2001 17:38:41 -0800
> >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> >Precedence: bulk
> >list-help: <mailto:[EMAIL PROTECTED]>
> >list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> >list-post: <mailto:[EMAIL PROTECTED]>
> >Delivered-To: mailing list [EMAIL PROTECTED]
> >Delivered-To: moderator for [EMAIL PROTECTED]
> >Message-ID:
<[EMAIL PROTECTED]>
> >X-Mailer: Internet Mail Service (5.5.2653.19)
> >X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
> >
> >I am trying to have the results of a ping displayed in the browser window

> >in
> >realtime. I read somewhere that embperl buffers the page before sending
it.
> >I ahve tried to disable this by setting EMBPERL_OPTIONS to include the
> >optEarlyHttpHeader, I also tried to use optRedirectStdout. Neither seemed

> >to
> >work. I get the page displayed after everything the ping is done. Any
ideas
> >on what I am doing wrong? Sample is below.
> >
> >         open( PING, "/usr/sbin/ping -I 1 $fdat{ ip } 100 5|" ) ;
> >         while ( <PING> ) {
> >                 print OUT "$_<BR>\n";
> >         }
> >         close(PING);
> 
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to