http://qs321.pair.com?node_id=150524

arc_of_descent has asked for the wisdom of the Perl Monks concerning the following question:

Hi, This is my first post, so plz excuse any noviceness that i may display!
I've been cracking my head against output buffering in cgi.
I'm using mod_perl with apache 1.3.22
Here is what i'm trying to do:

#!/usr/bin/perl # make output filehandle HOT $| = 1; print "Content-Type: text/html\r\n\r\n"; print "Sleeping for 10 seconds<br>\n"; sleep 10; print "Wide Awake Now.<br>\n";


Now what i expect in the browser is that the "Sleeping" string should be output and then 10 seconds later, the "Wide Awake" string should appear.
But unfortunately, both appear together after 10 seconds.
How do i seperate the two?
I basically want this for better html responses, as i do a lot of processing in my cgi and i want the user to know whats going on behind the scenes.
Does it have something to do woth apache buffering?
Thanx.

--
arc_of_descent