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

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

Thread Previous
Kevin Ryde
June 3, 2008 02:02
Re: [perl #55172] autoflush output after :encoding pushed
Message ID:
"Bram via RT" <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About