[Israel.pm] Redirecting duplicated STDOUT from child proccess to parent

Erez David introx at gmail.com
Tue Feb 19 22:01:28 PST 2008


Hi,

I am redirecting child's STDOUT to its parent with the following line:
open(STDOUT, ">&=PUTSTDOUT") || croak("Couldn't redirect STDOUT: $!");
    # PUTSTDOUT is a pipe to the parent.

Though, I would still like the child's STDOUT to bee written to the
screen and not only be redirected to its parent.

I have tried to use File::Tee module:
Use File::Tee qw(tee);
tee(STDOUT, '>&',  'PUTSTDOUT');

But it didn't work and the STDOUT wasn't piped to the parent process.

Any idea how can I do it?


Thanks
Erez



More information about the Perl mailing list