
File::tee is able to replicate data written to a perl stream into another streams. it is the perl equivalent of the shell utility tee(1).
it is implemeted around fork, creating a new process for every tee'ed stream. that way, there are no problems handling the output generated by external programs run with system|perlfunc/system or by xs modules that don't go through perlio.