perluser455 has asked for the wisdom of the Perl Monks concerning the following question:
my $log_filehandle; open( $log_filehandle, '>>', $log_filename ) or die("Can't open $log_filename for append: $!"); my $tee= IO::Tee->new( $log_filehandle, \*STDOUT ); my $tee2= IO::Tee->new( $log_filehandle, \*STDERR ); ##*STDERR = *$tee{IO}; --Adding or removing gives same output select $tee; -------my complete program code below-----------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing both to console and File
by 1nickt (Canon) on Apr 17, 2017 at 11:56 UTC | |
by perluser455 (Initiate) on May 17, 2017 at 10:15 UTC | |
by Eily (Monsignor) on May 17, 2017 at 14:54 UTC | |
|
Re: Printing both to console and File
by soonix (Chancellor) on Apr 17, 2017 at 12:49 UTC | |
|
Re: Printing both to console and File
by Anonymous Monk on Apr 17, 2017 at 16:37 UTC |