Is there a way to make this perl code capture stderr as well as stdout from a tcsh?

Posted by mikelong on Stack Overflow See other posts from Stack Overflow or by mikelong
Published on 2010-06-08T06:57:42Z Indexed on 2010/06/08 7:02 UTC
Read the original article Hit count: 223

Filed under:
|
    open UNIT_TESTER, qq(tcsh -c "gpath $dir/$tsttgt;  bin/rununittests"|);
    while(<UNIT_TESTER>){
        reportError($ignore{testabort},$tsttgt,"test problem detected for $tsttgt:$_ ") if /core dumped/;
        reportError($ignore{testabort},$tsttgt,"test problem detected for $tsttgt:$_ ") if /\[  FAILED  \]/;
        writelog($tsttgt,$_);
    }
    close UNIT_TESTER;

I have tried to redirect stderr to stdout using this syntax but it didn't work:

open UNIT_TESTER, qq(tcsh -c "gpath $dir/$tsttgt;  bin/rununittests >& "|);

I have also read the discussion on the perl FAQ but that was in relation to bash: http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q5.15.html

© Stack Overflow or respective owner

Related posts about perl

Related posts about tcsh