note
Moron
It's not abundantly clear what is wanted although taking your first statement in isolation, I would deduce (tentatively!) that (on *NIX) you'd want something like:
<code>
prog.pl | tee trapit.txt
</code>
and then postprocess what landed in the siphoned-off text file. <p>On Windows there is no tee, so you'd have to overload the print function with your own routine to print both to STDOUT and somewhere else.<p>
Update: BUT if you can live with the output being completely redirected rather than just copied then...
<code>
prog.pl > trapit.txt
</code>
works on Windows and *NIX
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-493758">
__________________________________________________________________________________
<p><i>^M Free your mind!</i><p>
</div></div>
631760
631760