nomis80 has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I want to open a process and read only its STDERR. This is very important because of STDOUT and STDERR interlacing. I can't just process one and then process the other because then STDOUT and STDERR will be deinterlaced. Anyway, here's what I tried using IPC::Open3:
my ($wtr, $rdr, $err); $wtr = '<&'; $rdr = '>&'; my $pid = open3($wtr, $rdr, $err, $program, @arguments); while (<$err>) { print STDERR $_; process_stderr($_); }
According to the IPC::Open3 manpage, the special strings '<&' and '>&' should do what I want, I think. I think I'm not understanding the manpage correctly.
I've tried something ugly using fork(), I've tried a plain system(), I've tried coding it in C, etc. I searched the archives before posting, but could find nothing. Please help me monks!
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading only STDERR
by Roy Johnson (Monsignor) on Apr 06, 2005 at 13:47 UTC | |
by nomis80 (Sexton) on Apr 06, 2005 at 13:52 UTC | |
by Roy Johnson (Monsignor) on Apr 06, 2005 at 13:57 UTC | |
by nomis80 (Sexton) on Apr 06, 2005 at 14:02 UTC | |
by Roy Johnson (Monsignor) on Apr 06, 2005 at 14:11 UTC | |
by rev_1318 (Chaplain) on Apr 06, 2005 at 14:45 UTC | |
|
Re: Reading only STDERR
by DrWhy (Chaplain) on Apr 06, 2005 at 14:00 UTC | |
|
Re: Reading only STDERR
by eieio (Pilgrim) on Apr 06, 2005 at 13:44 UTC | |
by nomis80 (Sexton) on Apr 06, 2005 at 13:47 UTC | |
|
Re: Reading only STDERR
by zentara (Cardinal) on Apr 07, 2005 at 11:56 UTC | |
|
Re: Reading only STDERR
by tweetiepooh (Hermit) on Apr 06, 2005 at 14:36 UTC | |
|
Re: Reading only STDERR
by nobull (Friar) on Apr 06, 2005 at 18:43 UTC |