[Israel.pm] catching STOUT and STDERR

Gabor Szabo gabor at perl.org.il
Sun Oct 17 04:35:16 PDT 2004


On Sun, 17 Oct 2004, Offer Kaye wrote:

> On Sun, 17 Oct 2004 00:46:23 +0200 (IST), Gabor Szabo wrote:
> >
> > I am running an external process via system() and would like to
> > catch its output in something (variable, file whatever)
>
> Then how can you use "system()"? You must use backticks (or "qx()"), no?

I am not sure.
      system("foo | tee out.txt");
would probably work the way I need, but I am not sure and I don't want to
use tee.


> Use IO::Tee:
> http://search.cpan.org/~kenshan/IO-Tee/

I think it cannot catch the STDOUT of other tasks but I am not sure.

Gabor




More information about the Perl mailing list