in reply to printing and mailing

This is very similar to a question answered in perldoc perlfaq5, namely How do I print to more than one file at once?.

If you open multiple filehandles and add everything to one big string, it's easy to write a loop. The other suggestions depend on being able to install stuff locally or having Unix commands available.

The IO::Tee module on the CPAN is another solution.