pipe for stderr and stdout

I

Ivan Novick

Hi,

From within perl i want to start a first process 'A' which writes to
both STDOUT and STDERR.

From the same perl script i want to start 2 more processes.

One, 'B', that reads from STDOUT of 'A"

The other, 'C', that reads from STDERR 'A'

Is this possible from within perl?

Thanks,
Ivan Novick
http://www.myperlquiz.com/
 
G

Gunnar Hjalmarsson

Ivan said:
From within perl i want to start a first process 'A' which writes to
both STDOUT and STDERR.

From the same perl script i want to start 2 more processes.

One, 'B', that reads from STDOUT of 'A"

The other, 'C', that reads from STDERR 'A'

Is this possible from within perl?

Yes.
 
G

Gunnar Hjalmarsson

Ivan said:
How about a hint as to how?

I'm not able to tell you any details, but I'd study "perldoc perlipc"
and "perldoc perlfork" and start playing with code.
 
T

Ted Zlatanov

IN> From within perl i want to start a first process 'A' which writes to
IN> both STDOUT and STDERR.

IN> From the same perl script i want to start 2 more processes.

IN> One, 'B', that reads from STDOUT of 'A"

IN> The other, 'C', that reads from STDERR 'A'

IN> Is this possible from within perl?

I believe it's possible with IPC::Run, which has pretty much every way
of running a program and capturing its output I ever needed. I can't
give you the exact solution but you'll see very relevant examples in the
first pages of the module's documentation (especially feeding one
child's output to another). You can install IPC::Run from CPAN.

Ted
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,765
Messages
2,569,568
Members
45,042
Latest member
icassiem

Latest Threads

Top