Help for this page

Select Code to Download


  1. or download this
     ( ( perl foo.pl | tee -a output.log ) 3>&1 1>&2 2>&3 3>&- | tee -a er
    +ror.log ) 3>&1 1>&2 2>&3 3>&-
    
  2. or download this
    my ($output_cache, $error_cache);
    *STDOUT = multiplex( \*STDOUT, $output_cache, "$log_dir/output.$0" );
    ...
      my $tee = IO::Tee->new( $handle, $cache_handle, $log_handle );
      return $tee;
    }