xafwodahs has asked for the wisdom of the Perl Monks concerning the following question:
when run, this script produces the obvious results (all numbers in order).print STDOUT "out 1\n"; print STDOUT "out 2\n"; print STDOUT "out 3\n"; print STDERR "err 4\n"; print STDERR "err 5\n"; print STDERR "err 6\n"; print STDOUT "out 7\n"; print STDOUT "out 8\n"; print STDOUT "out 9\n"; print STDERR "err A\n"; print STDERR "err B\n"; print STDERR "err C\n";
use IPC::Open3; use Symbol; $OUTERR = gensym(); $IN = gensym(); print STDOUT "running...\n"; $pid = open3($IN, $OUTERR, $OUTERR, 'outerr.pl') or die $!; while ( wait != $pid ) {}; print STDOUT "done...\n"; while (<$OUTERR>) { print STDOUT "got: $_"; } close OUTERR;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IPC::Open3 confusion
by BazB (Priest) on Jan 31, 2003 at 21:20 UTC | |
|
Re: IPC::Open3 confusion
by tall_man (Parson) on Jan 31, 2003 at 21:19 UTC | |
|
Re: IPC::Open3 confusion
by pg (Canon) on Jan 31, 2003 at 22:13 UTC | |
by xafwodahs (Scribe) on Feb 04, 2003 at 20:18 UTC | |
|
Re: IPC::Open3 confusion
by zentara (Cardinal) on Feb 01, 2003 at 19:27 UTC |