If I get an IO::Pipe object, how can I use it to redirect STDOUT? I'm in the
process of writing a replacement for the open(FOO,"some_process|") idiom for
a subprocess and because I like debugging, I don't want ctrl-C being sent to
the child process. I see this as
$pipe = IO::Pipe->new();
$pid = fork();
defined($pid) or croak("oops, fork bombed");
if (!$pid)
{
$pipe->writer;
open(STDOUT,">&$pipe") || croak "can't redirect stdout";
exec($cmd);
}
# reader parent continues here
But that's not working. Any ideas?
BTW -- Graham, I'm cc'ing you on this. As this seems to me to be pretty
common, assuming there is a correct way to do this, could you maybe include
this in the POD?
---
[EMAIL PROTECTED] | Dog is my co-pilot.