Server Push technique

I am trying to run my script with Optiperl built in web server, it works great except that for some reason it cannot do autoflush. What I want is to set

$|=1;

so that the output of my script would be printed immediately instead of waiting for the entire script to finish. Example:

$| = 1;
foreach(0..2){
sleep 1;
print "$_";
}

this little script should print out a number every second, instead with the internal server it waits for the entire script to finish. is there anyway to circumvent this problem.

Answer:
This works in the console, but the problem that makes it not work is probably the browser being used (IE 6 or 7 whatever you have installed) than the server. Try running in Firefox wich supports this technique.

It will work with optiperl's internal server so copy the localhost address into firefox, or set-up firefox as the secondary browser when running.

To set up as a secondary browser, go to tools / Options / Running and in "Select secondary browser" enter the full path to Firefox. Afterwards to run select Run / Run in external browser Afterwards to run select Run / Run in external browser.

09.05.2007. 01:34

This article hasn't been commented yet.

Write a comment

:

:

:


6 + 4 =