http://www.perlmonks.org?node_id=208644


in reply to printing to STDOUT and a Logfile

This is the way I do it. It my be too simple for all your logging needs.
perl -e 'print "Hello\n";' | tee logfile
... or If I also want to trap STDERR I do ...
perl -e 'print "Hello\n;' >& logfile
... but then again does logging need to be complicated?