In a perl script, I am capturing all the STDOUT and STDERR using the below code:
Code:
open STDOUT, '>>', "$log_file" or die "Can't redirect STDOUT: $!";
open STDERR, ">&STDOUT" or die "Can't add to STDOUT: $!";
main();
Here I am logging all those are generated from main() but how can I add a timestamp infront of each line of STDOUT ?