in reply to Perl stdout timing/formatting

Try adding $|++; at the top of your script.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

Replies are listed 'Best First'.
Re^2: Perl stdout timing/formatting
by dburke (Novice) on Sep 12, 2012 at 17:31 UTC

    This seemed to work really well, thank you. It took me a while to figure out how to Google that though. :P So now I have a very basic understanding of what that is and why I would put it in my script, but I still have one question; does it only need to be put at the beginning of my script and only once? I currently have it at the start of every while(1) so that it 'flushes' before each part of the script runs. Is that the right thing to do or is it just redundant?

    Thank you for the help!

      I still have one question; does it only need to be put at the beginning of my script and only once?

      Once at the top is all that is needed. More than that is redundant.

      This is an often recommended reference.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong