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