http://www.perlmonks.org?node_id=1188129
perluser455 has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, i am writing a perl code to run one of my products and as part of that i wanted the log file to print both STDERR and STDOUT to log and Blackscreen. Below is code am using currently and it prints all the details to Blackscreen but only STDOUT to file , i would like to print even STDERR ,am using strawberry perl. Any suggestions here can be of great help. Code:
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-----------