Is there a simple way in Perl to send STDOUT or STDERR to multiple places without forking, using File::Tee, or opening a pipe to /usr/bin/tee?
Surely there is a way to do this in pure perl without writing 20+ lines of code, right? What am I missing? Similar questions have been asked, both here on SO and elsewhere, but none of the answers satisfy the requirements that I not have to
- fork
- use File::Tee / IO::Tee / some other module+dependencies whose code footprint is 1000x larger than my actual script
- open a pipe to the actual tee command
I can see the use of a Core module as a tradeoff here, but really is that needed?