in reply to STDOUT, STDERR sniffer

inguanzo,
There are several ways to do this. You may want to consider one of the easiest and have a look at IO::Tee.

Cheers - L~R

This assumes you want to allow the program to run/output normally but also have a copy of the STDOUT/STDERR output

Replies are listed 'Best First'.
Re^2: STDOUT, STDERR sniffer
by inguanzo (Acolyte) on Jul 21, 2004 at 01:42 UTC
    IO::Tee is a very nice module, Thks a lot !

    But maybe perl is not the solution. The problem is: the script must run several applications (compilation) that write directly to STDOUT, STDERR; those outputs need to be captured and analyzed in order to implement a kind of autoreporting.

    What about "script" unix command ? That's exactly what I need, Perl must be able to do something like this.

      The behavior of script is quite similar to Expect. Maybe that will help, if the problem is that your programs are giving different output because they're not hooked up to ttys.

      Or maybe you could describe what IO::Tee isn't doing that you would like it to.