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
- $| doesn't work with mod_perl pradeep kumar
- Re: $| doesn't work with mod_perl Alexander Charbonnet
- Re: $| doesn't work with mod_perl Alexander Charbonnet
- Re: $| doesn't work with mod_perl Tom Schindl
- Re:[mp2] $| doesn't work with mod_perl pradeep kumar
- Re: [mp2] $| doesn't work with mod_perl pradeep kumar
- Re: [mp2] $| doesn't work with mod_p... Tom Schindl
- Re: [mp2] $| doesn't work with ... Tom Schindl
- Re: [mp2] $| doesn't work w... pradeep kumar
- Re: [mp2] $| doesn't wo... Tom Schindl
- Re: [mp2] $| doesn't work with mod_p... Alexander Charbonnet