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