Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??
If you don't need to know which parts are from stderr, and which are from stdout, i would suggest appending 2>&1 to your command. This will cause the unix shell to rediect them both so you can read them.

On the other hand, if they have to be seperate, i would suggest :
  1. using pipe() twice
  2. fork()'ing off a child.
  3. Using open() in the child to reset STDOUT and STDERR to the writing ends of the pipes.
  4. using exec() in the child to start the command
  5. let the parent (from the fork()) read the other ends of the pipes, and process them seperatly.

... just a thought.
i had a memory leak once, and it ruined my favorite shirt.

In reply to Re: "Exception" handling and more... by MZSanford
in thread "Exception" handling and more... by r.joseph

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.