in reply to Executing external Programs

# STDOUT reader open PIPE_1, "outer.pl 2>/dev/null |" # STDERR reader open PIPE_2, "outer.pl 1>/dev/null |" # outer.pl print STDERR "stderr!$/"; print STDOUT "stdout!$/"; ... print while <PIPE_1>; # stdout! print while <PIPE_2>; # stderr! ...


Replies are listed 'Best First'.
Re^2: Executing external Programs
by polettix (Vicar) on Mar 22, 2005 at 18:35 UTC
    I don't see the point in this solution. Aren't the two opens supposed to spawn two different subprocesses? In this way, you're getting the stdout from one of them and stderr from the other, but probably you don't want to do that double work (not counting that the two processes could collide, have different behaviours and outcomes, etc etc).

    But it's highly probable that I'm missing something about some interaction from the two opens :(

    Flavio.

    -- Don't fool yourself.