Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: what is the meaning of $| in perl?

by eyepopslikeamosquito (Chancellor)
on Mar 10, 2014 at 19:13 UTC ( #1077742=note: print w/replies, xml ) Need Help??

in reply to what is the meaning of $| in perl?

Now that you know what $| is, I suggest you don't use it.

Instead of your global LOGFILE file handle and:

select(LOGFILE); $| = 1; select(STDOUT);
it is preferable to use a lexical file handle ($logfile say) for your log file and then simply:
use IO::Handle; # ... $logfile->autoflush();

With recent Perls (5.8+), there's no need anymore to confusingly change the (global) default destination for print statements via the one-argument form of select -- for more details, see Perl Best Practices, chapter 10 and Perl tip: Buffering and IO::Handle (for Perl 5.14+ you don't need use IO::Handle).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1077742]
[RonW]: thanks
[LanX]: I thought MST perl was obvious ;-)
[RonW]: I have so much accumulated in my memory that finding the right item at a given moment often fails

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-08-18 20:38 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (310 votes). Check out past polls.