in reply to Append the timestamp before and after the data in the logfile
It uses DateTime to generate the timestamp but changing it to use localtime should be pretty simple.select STDOUT; $| = 1; unless (open STDOUT, "|-") { eval { while(<>) { my $now = DateTime->now; print "$now: $_"; } }; exit(0); }
|
---|