Re: dynamically output messages on browser.

2000-04-02 Thread Sean Chittenden

 I wrote perl script to out put messages. It is supposed to output one
 line per 4 seconds. while loop has sleep(4), then print messages until
 all messages print out.

 But the server did not output the result per 4 seconds instead output
 all of results after 40 seconds How can I control that. Thanks.

Apache is buffering the output.  Put a "\n" at the end of your
print statements and you should be okay, or an alternative would be to use
$r-rflush after each print statement.  -sc

--
Sean Chittenden





Re: dynamically output messages on browser.

2000-04-02 Thread Matt Carothers


On Sun, 2 Apr 2000, Hui Zhu wrote:

 I wrote perl script to out put messages.
 It is supposed to output one line per 4 seconds.
 But  the server did not output the result per 4 seconds instead output
 all of results after 40 seconds

Set $| = 1;

OT: You can do neat stuff with $| = 1 and Javascript.  I wrote a CGI that
does some time consuming checks and displays the results by changing the
graphics on the output page with script blocks as the data comes in.
Both Netscape and IE execute the scripting as soon as they receive it, 
rather than waiting for the page to finish loading.

- Matt