develooper Front page | perl.perl5.porters | Postings from January 2005

$| and buffered io in Perl.

From:
Ananth Kesari
Date:
January 14, 2005 03:40
Subject:
$| and buffered io in Perl.
Message ID:
s1e74d32.035@lucius.provo.novell.com
Hi,

I have another question. I am testing the attached Perl script which
uses $|.

On Linux, the first set of 5 prints will be buffered and output on the
screen appears after the total delay time of 5 seconds. After that
Perl
encounters $|=1 (auto flush ON). From here, the second set of
5 printouts comes after every 1 sec. This indicates that the prints
were
buffered in the first place. Setting the auto flush to be on, disabled
this
buffering and the outputs then stated coming immediately.

But on NetWare it is not working like this. Both the sets of 5
printouts
all come with only 1 second delay without any buffering. Due to this
there is no effect of setting or resetting $| on NetWare since there
was no buffering in the first place.

Can you help me figure out where the problem could lie? Is there
a way we can set buffered output / io in Perl? Is it OS specific or
Perl
specific?

Please clarify.
Thanks so much in advance for your help.

Ananth.





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