Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: behaviour of STDOUT and STDERR

by tbone1 (Monsignor)
on May 15, 2009 at 12:21 UTC ( #764257=note: print w/replies, xml ) Need Help??

in reply to behaviour of STDOUT and STDERR

I don't have a lot to add, except maybe perspective so you understand why things are the way they are.

Think of why STDOUT and STDERR exist seperately and what their first use is. STDOUT prints to the screen, log, report, etc. As long as the data gets there, you're okay. So STDOUT's default behavior is to write the contents of the buffer when it gets to it. (With modern computers, this isn't such a big deal, but "back in the day", it made for more efficient resource use.)

STDERR, on the other hand, was designed to report error information. And if an error is going to make the process crash, you want that error information to be written right now so it gets stored before the process ends. So when something gets to STDERR it gets printed immediately, for good reason.

Therefore, it is not surprising that things will get intertwined if you are writing STDOUT and STDERR to the same location, just by the nature of the default behaviors.

tbone1, YAPS (Yet Another Perl Schlub)
And remember, if he succeeds, so what.
- Chick McGee

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2016-10-27 00:52 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (350 votes). Check out past polls.