Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Multiplexing STDOUT and STDERR

by kilinrax (Deacon)
on Nov 12, 2003 at 18:56 UTC ( [id://306592]=perlquestion: print w/replies, xml ) Need Help??

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;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://306592]
Approved by Paladin
Front-paged by davido
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found