Pure Perl emulation of GNU tee
