I am trying to run a Perl script in Linux and log all output to STDOUT and STDERR to a file using:
open (STDOUT, "| tee -i $transcript_file");
open (STDERR, "| tee -ai $transcript_file");
The script that uses this works roughly as follows:
- Create an environment for running a tool. Has many
print
,warn
and possiblydie
statements. - Run the tool (Currently using
system
command). This produces a lot of output which I want to appear on STDOUT, but not in the logfile (The tool creates its own logfile). - Analyze the results, cleanup and exit. Has many
print
,warn
and possiblydie
statements.
Everything works correctly except I would like to exclude the output of step 2 from the log. Is there a simple way to achieve this?
Thanks,
PS: This is my first question on stackoverflow. Please help me in asking questions correctly if I have not done so.