$this->{'stdout_log'} = \*FH_STDOUT; # These files have already been opened. $this->{'stderr_log'} = \*FH_STDERR; # Save the previous filehandles for STDOUT and STDERR so we # can restore them when we're done. $this->{'_stdout'} = \*STDOUT; $this->{'_stderr'} = \*STDERR; # Set the new filehandles for STDOUT and STDERR *STDOUT = $this->{'stdout_log'}; *STDERR = $this->{'stderr_log'};