E.g.
- $stream1 is the STDOUT of a child process and $stream2 is the STDERR of the same child process
- $stream1 is one child process and $stream2 is another child process
Is there a possiblility in perl to monitor two or more streams at the same time?
So we loop as long as anything pops-up in any of the streams and we take whatever comes first either in $stream1 or $stream2.
Something like
while (my $line = <$stream1 or $stream2> ) {
#do something with the $line
}
??