Help for this page

Select Code to Download


  1. or download this
    # Save the previous filehandles for STDOUT and STDERR so we
    # can restore them when we're done.
    ...
    *STDERR_LOG = $this->{'stderr_log'};
    open(STDOUT, ">&STDOUT_LOG");
    open(STDERR, ">&STDERR_LOG");
    
  2. or download this
    if(defined($this->{'_stdout'}))
    {
    ...
        print STDERR "STDERR restored\n";
        undef($this->{'_stderr'});
    }