in reply to Re^3: print the output on the screen and to a file
in thread print the output on the screen and to a file
Thanks to everyone for your replies. I have used this code suggested by "tobyink" and it worked for me. -------- If there are many such print statements, then define a function to han +dle it: sub my_tee { my $handle = shift; print $handle @_; print @_; } open my $fh, '>>', 'output.txt' or die "$!"; my_tee $fh => ("Greetings!\n"); my_tee $fh => ("Hello", " ", "World"); ----------
|
|---|