palette has asked for the wisdom of the Perl Monks concerning the following question:

I have a script maketest.pl running in scheduler.
It uses Test::Harness and executes all other test scripts

When the maketest.pl is executed from command line all the tests and the results are displayed on the screen.

I need it to redirect to a file as it appears on the screen.

With that intention I tried doing, perl maketest.pl > <filename>.

But it only have a summary of the tests and it's not showing the details of all tests as it appears on the screen.

Nedd to know how to achieve this.

Replies are listed 'Best First'.
Re: Test harness
by skirnir (Monk) on May 30, 2008 at 12:49 UTC
    Sounds like you are redirecting STDOUT to <filename> when you really want STDERR.
    If you are in a Unix environment, try

    perl maketest.pl 2> <filename>

      But that would only put stderr in the file. To really put all text you see on screen to the file, use
      perl maketest.pl 1> out.txt 2>&1