Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > pipe for stderr and stdout

Reply
Thread Tools

pipe for stderr and stdout

 
 
Ivan Novick
Guest
Posts: n/a
 
      03-26-2008
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/
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      03-27-2008
Ivan Novick wrote:
> 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.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
 
Ivan Novick
Guest
Posts: n/a
 
      03-27-2008
On Mar 26, 5:33 pm, Gunnar Hjalmarsson <(E-Mail Removed)> wrote:
> Ivan Novick wrote:
> > 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.
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl


How about a hint as to how?

Ivan Novick
http://www.myperlquiz.com/
 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      03-27-2008
Ivan Novick wrote:
> On Mar 26, 5:33 pm, Gunnar Hjalmarsson <(E-Mail Removed)> wrote:
>> Ivan Novick wrote:
>>> 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.

>
> 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.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
Ted Zlatanov
Guest
Posts: n/a
 
      03-27-2008
On Wed, 26 Mar 2008 16:17:02 -0700 (PDT) Ivan Novick <(E-Mail Removed)> wrote:

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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pipe stdout && stderr to a TkLabel widget rantingrick Python 3 02-01-2009 07:00 PM
Reading stdout & stderr from a pipe with popen3 Matt Mencel Ruby 1 07-07-2008 03:12 PM
Problems redirecting STDOUT (NOT sys.stdout) to a pipe. Elad Python 0 03-19-2006 01:30 PM
Re: embedding Python and changing stdin, stdout and stderr Vincent Touquet Python 0 09-06-2004 04:35 PM
embedding Python and changing stdin, stdout and stderr Vincent Touquet Python 1 09-03-2004 12:25 PM



Advertisments