Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: I think I'm misunderstanding $|

by quester (Vicar)
on Dec 18, 2007 at 08:14 UTC ( [id://657616]=note: print w/replies, xml ) Need Help??


in reply to Re: I think I'm misunderstanding $|
in thread I think I'm misunderstanding $|

I just tried this under Apache 1.3.34 (ancient I know, but it was handy) and Firefox 2.0.11, and it renders the text immediately. Even if I replace the sleep 5 with this:
for (1..15) { print; sleep 1; }
it will update the page once per second.

You might check if you are using a web proxy. The proxy could accumulate text before forwarding it to the browser.

One thing to try is to terminate the current HTML element with something like <br> or <p>. As ikegami mentioned, it is not easy for the browser to guess exactly when it is time to update the display, and a paragraph break might give it a better clue.

If all else fails, you could use DHTML: give an html id attribute to an HTML element you want to update, and spit out snippets of Javascript to update the element attributes. I have done that where a table in the middle of the page needed to be updated as the script in back of the page ran. It's pretty to watch it run, but it's not at all pretty to write, especially if you have to support both IE and FireFox.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://657616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-24 00:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found