Thanks for that reply. I needed to keep them separate but managed in the end to find both a solution and the reason for me to have the trouble in the first place. Seems like I forgot to flush the stream which made it seem the processes did not work in parallel;

<P> select((select(STDOUT), $|=1)[0]); <P> And the whole script that made it all work: <br> <br>$pid = open3(*CMD_IN, *CMD_OUT, *CMD_ERR, $path, @arguments); <br> close(CMD_IN); <br> <br> $selector = IO::Select->new(); <br> $selector->add(*CMD_ERR, *CMD_OUT); <br> <br> while(@ready = $selector->can_read) { <br> foreach my $fh (@ready) { <br> if(fileno($fh) == fileno(CMD_ERR)) { <br> my $line = scalar <CMD_ERR>; <br> if(defined $line) { <br> parseErrorStream($line); <br> } <br> } <br> else { <br> my $line2 = scalar <CMD_OUT>; <br> if(defined $line2 and $print eq 1) { <br> parseStandardStream($line2); <br> } <br> } <br> $selector->remove($fh) if eof($fh); <br> } <br> } <br> close(CMD_OUT); <br> close(CMD_ERR);

In reply to Re^4: How to share streams between processes by rapide
in thread How to share streams between processes by rapide

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.