Re: can't flush buffer?

2000-12-17 Thread quagly


oops, typos in my message.

 In fact, I have done just as you suggest, but it doesn't work.

Thanks,
~quagly



Re: can't flush buffer?

2000-12-17 Thread quagly

Yes, I have read all of that.  That is what I am following.

It just doesn't work.

~quagly



Re: can't flush buffer?

2000-12-17 Thread Stas Bekman

On Sun, 17 Dec 2000, quagly wrote:

> 
> As a test of my new mod_perl abilities I wrote a trivial SQL client.
> It works, but if the query returns many rows then it takes a while.
> As a first step I thought I would call $r->rflush; with every row
> printed but 
> this does not work.  I also tried $|=0; with no effect.

$|=1 or $|++

$|=0 is the opposite (do bufferring!)

> while ($sth->fetch) {
> print "",
> map("$_",@cols),
>  $r->rflush;
> }

How about this?
while ($sth->fetch) {
print "",map("$_",@cols);
$r->rflush;
}

You may also want to find some nice value and do:

my $rows = 0;
while ($sth->fetch) {
print "",map("$_",@cols);
# flush every 10 rows
$r->rflush unless ++$rows % 10;
}

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  






Re: can't flush buffer?

2000-12-17 Thread Ajit Deshpande

On Sun, Dec 17, 2000 at 09:54:38AM -0800, quagly wrote:
> 
> As a test of my new mod_perl abilities I wrote a trivial SQL client.
> It works, but if the query returns many rows then it takes a while.
> As a first step I thought I would call $r->rflush; with every row
> printed but 
> this does not work.  I also tried $|=0; with no effect.

See:

http://perl.apache.org/guide/performance.html#Using_1_Under_mod_perl_and_Be