I was going to suggest something like that, but then I
realized that I did not know off of the top of my head
what would happen with buffering, whether tee did it,
or not. In general if I don't know the answer to a
question like that immediately, I usually think up a pure
Perl solution. Besides which, then I know it is cross-platform code. :-)