In Perl, how to clone output to stdout and log file in real time
I want to clone the output to the console as well as the log file at the same time. Here is my code snippet:
open STDOUT, ">>", "temp.txt" or die "";
system("echo This is a sample output..........");
But here I am only getting output in temp.txt
, not on the console. Can you suggest a solution? I am using Windows.
+3
source to share