Even textbook examples are not working. Is it possible my apache based host is preventing this kind of output from working correctly?
the script seems simple enough, is this syntax correct?
#!/usr/bin/perl
$¦ = 1;print "Content-type: multipart/mixed;boundary=\"boundary\"\n\n";
print "\n--boundary\n";
print "Content-type: text/html\n\n";for ($x = 0; $x < 10; $x++)
{
print "Line $x<BR>\n";
sleep 1;
}exit;
Should be showing one line a second, not all 10 lines dumped at once after 10 second (like its doing) :(
Thanks for any help!
(unless someone has a different approach to accomplish this from the server side?)
There is no way to accomplish this universally even limiting to modern browsers, you must use client pull. I've given up and moved on.
(it has nothing to do with apache/perl buffering, HTML simple doesn't work with byte by byte data, it rendered the page based on the browser's own decision)
0] use a sniffer [ethereal i.ex.], so you can see if the client gets the line each second, or not.
Maybe you can increase the value of sleep, so it's easier to watch the ethereal logs.
1] try to delete your 2 boundary 'print' lines, leaving only the third, and see what happens.
I've made successfully something similar, working with all version of IE, even with images:
printed out by the browser slowly.. slowly..
[but, btw, I've never used multipart/mixed]