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.