pipe for stderr and stdout

Discussion in 'Perl Misc' started by Ivan Novick, Mar 26, 2008.

  1. Ivan Novick

    Ivan Novick Guest

    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/
     
    Ivan Novick, Mar 26, 2008
    #1
    1. Advertising

  2. 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
     
    Gunnar Hjalmarsson, Mar 27, 2008
    #2
    1. Advertising

  3. Ivan Novick

    Ivan Novick Guest

    On Mar 26, 5:33 pm, Gunnar Hjalmarsson <> 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/
     
    Ivan Novick, Mar 27, 2008
    #3
  4. Ivan Novick wrote:
    > On Mar 26, 5:33 pm, Gunnar Hjalmarsson <> 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
     
    Gunnar Hjalmarsson, Mar 27, 2008
    #4
  5. Ivan Novick

    Ted Zlatanov Guest

    On Wed, 26 Mar 2008 16:17:02 -0700 (PDT) Ivan Novick <> 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
     
    Ted Zlatanov, Mar 27, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vincent Touquet
    Replies:
    1
    Views:
    594
    Adrian B.
    Sep 3, 2004
  2. Vincent  Touquet
    Replies:
    0
    Views:
    444
    Vincent Touquet
    Sep 6, 2004
  3. Elad
    Replies:
    0
    Views:
    415
  4. rantingrick
    Replies:
    3
    Views:
    429
    rantingrick
    Feb 1, 2009
  5. Matt Mencel
    Replies:
    1
    Views:
    172
    ara.t.howard
    Jul 7, 2008
Loading...

Share This Page