Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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


In reply to Re: behaviour of STDOUT and STDERR by tbone1
in thread behaviour of STDOUT and STDERR by thiagu_mvt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2023-12-07 04:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (32 votes). Check out past polls.

    Notices?