in reply to Re^2: Clever autoflush detail
in thread Autoflush and web browsers (was: Clever autoflush detail)

Are you sure?

from your code: print $cgi->header('text/html');

Replies are listed 'Best First'.
Re^4: Clever autoflush detail
by talexb (Chancellor) on Jun 20, 2007 at 19:45 UTC

    The first Perl script in my original post had 'text/plain'; that's the one that I'm talking about.

    And as blahblah correctly points out lower down, this appears to have something to do with CGI, because if I remove that dependency as follows:

    #!/usr/bin/perl -w $|=1; { print "Content-type: text/plain\n\n"; print "Autoflush is currently " . ($|?"on":"off") . ".\n"; for ( 1..5 ) { print "Value is $_.\n"; sleep 1; } print "Autoflush is currently " . ($|?"on":"off") . ".\n"; }

    The script works properly. So CGI is ignoring $| and doing its own caching. Now I know.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds