Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: delayed print statement?

by epoptai (Curate)
on Jul 09, 2001 at 11:24 UTC ( #94921=note: print w/ replies, xml ) Need Help??


in reply to delayed print statement?

Turn off buffering by adding this before you print anything:

$| = 1; or $|++;
Read all about it in Suffering from Buffering?

--
Check out my Perlmonks Related Scripts like framechat, reputer, and xNN.


Comment on Re: delayed print statement?
Download Code
Replies are listed 'Best First'.
Re: Re: delayed print statement?
by bwana147 (Pilgrim) on Jul 09, 2001 at 13:59 UTC

    And, as has been pointed out many a time, $| affects the currently selected file handle. The turn off buffering on something else, you have to temporarily select, e.g., like so:

    select((select(SOMETHING_ELSE), $| = 1)[0]);

    --bwana147

Re: Re: delayed print statement?
by the_0ne (Pilgrim) on Jul 09, 2001 at 18:33 UTC

    You're right epoptai, I just read Suffering from Buffering? this weekend because I was having the same sort of problem and it helped a great deal to understand the pros/cons of buffering and how to get around it, if needed.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://94921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2015-07-31 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls