How to read STDERR messages from a third party program?

Discussion in 'Perl Misc' started by Arne Goetje, Feb 16, 2004.

  1. Arne Goetje

    Arne Goetje Guest

    Hi,

    I want my perl script to start a third party program (daemon) in the
    background and capture the messages it sends out onto STDERR
    occasionally.
    These messages should be processed by my perl script.

    Any idea how to do this?

    Please CC to me. Thanx.
    Arne Goetje, Feb 16, 2004
    #1
    1. Advertising

  2. Arne Goetje wrote:
    >
    > Hi,
    >
    > I want my perl script to start a third party program (daemon) in the
    > background and capture the messages it sends out onto STDERR
    > occasionally.
    > These messages should be processed by my perl script.
    >
    > Any idea how to do this?


    If your daemon doen't do any output to stdout, you could just redirect
    stderr to stdout:
    open(DAEMON, "daemon 2>&1 |");

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
    Josef Möllers, Feb 16, 2004
    #2
    1. Advertising

  3. Arne Goetje

    fifo Guest

    At 2004-02-16 10:18 +0100, Josef Möllers wrote:
    > Arne Goetje wrote:
    > > I want my perl script to start a third party program (daemon) in the
    > > background and capture the messages it sends out onto STDERR
    > > occasionally.
    > > These messages should be processed by my perl script.
    > >
    > > Any idea how to do this?

    >
    > If your daemon doen't do any output to stdout, you could just redirect
    > stderr to stdout:
    > open(DAEMON, "daemon 2>&1 |");
    >


    Or if it does write to stdout, you can suppress this
    with "daemon 2>&1 1>/dev/null |".
    fifo, Feb 16, 2004
    #3
  4. Arne Goetje

    Joe Smith Guest

    Arne Goetje wrote:

    > background and capture the messages it sends out onto STDERR


    That's an FAQ.

    perldoc -q stderr

    Look at IPC::Open3.
    Joe Smith, Feb 17, 2004
    #4
    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. Kieran Benton
    Replies:
    3
    Views:
    493
    Ray Cassick \(home\)
    Sep 11, 2003
  2. Billy Porter
    Replies:
    0
    Views:
    1,001
    Billy Porter
    Jun 25, 2003
  3. Mikael Engdahl

    Strange error when calling third party assembly

    Mikael Engdahl, Aug 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    349
    Mikael Engdahl
    Aug 8, 2003
  4. Cowboy \(Gregory A. Beamer\)

    Re: Use Third Party HTML Designer

    Cowboy \(Gregory A. Beamer\), Nov 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    353
    Marty Cruise
    Nov 5, 2003
  5. Nick Zdunic
    Replies:
    0
    Views:
    890
    Nick Zdunic
    Nov 5, 2003
Loading...

Share This Page