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

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

Thread Previous | Thread Next
From:
Bram
Date:
June 2, 2008 15:12
Subject:
Re: [perl #55172] autoflush output after :encoding pushed
Message ID:
20080603001118.g8p7ow68qccco0cg@horde.wizbit.be
Citeren Kevin Ryde <perlbug-followup@perl.org>:

> # New Ticket Created by  Kevin Ryde
> # Please include the string:  [perl #55172]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=55172 >
>
>
> On the debian i386 packaged perl 5.10.0 the foo.pl program below run
> just as "perl foo.pl" doesn't print "hello" until after 10 seconds,
> whereas I hoped setting $|=1 would force immediate output.
>
> Using IO::Handle->flush seems to have the same non-effect, ie. doesn't
> flush the hello.
>
>
> But it's possible I'm labouring under some misunderstanding of what
> flush/autoflush should do.  I thought it meant "make the output go to
> the system", but some experimenting with how a pushed :encoding layer or
> a :perlio buffer layer call their sub-layer "Write" and "Flush" funcs
> made me wonder if it's not.  (I saw Flush after every 4096 or 1024 byte
> block, not only in response to a top-level autoflush or flush method
> call.)  At any rate if non-output in foo.pl below is what's expected
> then a little further explanation in perliol or perlvar $| would be
> good.


You need to turn autoflush on beforing the print statement.
Or add print "" after turning autoflush on.



Kind regards,

Bram



Thread Previous | Thread Next


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