in reply to Re^2: formatting STDOUT
in thread formatting STDOUT

well, it's very simple to use, after it is called on a perl script, every line written to STDOUT will get the datestamp prepended.

for instance, create a module like:

package MyApp::Logger; select STDOUT; $|=1; unless (open STDOUT, '|-') { eval { while(<>) { print scalar(localtime), ' ', $_; } }; exit(0); } 1;
and then from your script, just use the module, and then print whatever you want:
#!/usr/bin/perl use MyApp::Logger; print "foo\nbar\n";