Hi Agnello,

On Thu, 22 May 2014 11:43:46 +0530
Agnello George <agnello.dso...@gmail.com> wrote:

> Hi
> 
> I just came across this special var $| , autoflush , jsut wondering how and
> where to use this . Can some one help me understand the concrete use of
> this special var.
> 

First of all, you should not use "$|" directly - you should do:

«
use IO::Handle; # Only needed for relatively old versions of perl.

STDOUT->autoflush(1);
»

See: http://perl-begin.org/tutorials/bad-elements/#properly_autoflushing

For more information about why it is sometimes desirable:

1. http://stackoverflow.com/questions/4538767/how-flush-a-file-in-perl

2. http://www.plover.com/FAQs/Buffering.html

3. perlbot (an IRC bot on Freenode) has this to say about it:

«
<perlbot> rindolf: https://en.wikipedia.org/wiki/Shishi_odoshi or in C
http://www.freebsd.org/cgi/man.cgi?query=setvbuf or in Perl see
http://perl.plover.com/FAQs/Buffering.html - tl;dr - $fh->autoflush(1)
(plus use IO::Handle under ancient perl versions) 
»

Best regards,

        Shlomi Fish


-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Beginners Site for the Vim text editor - http://vim.begin-site.org/

Sophie: Let’s suppose you have a table with 2^n cups…
Jack: Wait a second! Is ‘n’ a natural number?

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to