develooper Front page | perl.perl5.porters | Postings from June 2008

Re: [perl #55172] autoflush output after :encoding pushed

Thread Previous
From:
Kevin Ryde
Date:
June 3, 2008 02:02
Subject:
Re: [perl #55172] autoflush output after :encoding pushed
Message ID:
87lk1n8jhj.fsf@blah.blah
"Bram via RT" <perlbug-followup@perl.org> writes:
>
> You need to turn autoflush on beforing the print statement.

Umm, that's not what I was trying to get at.  It's that unflushed output
sitting there when a :encoding is pushed can't then be flushed with $|
or ->flush().

> Or add print "" after turning autoflush on.

I tried that, it has no effect.  Printing a non-empty string does make
it go.


My gues is that :encoding will pass on a flush call to its sublayer only
when it's seen output pass through itself.  I guess not flushing the
sublayer when you know there's nothing to go out is a nice optimization,
but when first pushed it can't know what might or might not be sitting
beneath it.  (As before, assuming "make the output go" is what flush
really means.)

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About