Hi,

 I have a perl script which uses $| to set autoflush on. Basically, it flushes after every print. This script is working fine from the command line when run using standalone perl interpreter. But when the same script is accessed via mod_perl/apache setup, mod_perl is not flushing after every print, instead buffering and printing all output at one shot.
Any idea why $| is not working with mod_perl.

Here is my sample script:

#!/usr/bin/perl -w

use CGI qw/:standard/;
use strict;
select(STDOUT);
$| = 1;
print STDOUT "Content-type: text/html\n\n"; print STDOUT <<END; <html> <head> </head> <body> END print STDOUT 'hello'; print STDOUT '<br>'; sleep(2); print STDOUT 'World'; print STDOUT '<br>'; sleep(2); print STDOUT 'Testing'; print STDOUT "</body></html>";


Thanks in advance,
Pradeep

Reply via email to