in reply to permute n elements

You can re-direct the output of a program in dos using the > character:
c:\>perl script.pl > out.txt
But you can also highlite the text in the dos-box and right click to get it onto the Microsoft clipboard. (It doesn't say anything, but trust me the text has been copied)

The best solution, however, is to write your script to print to a file directly. Read open and print and close and remember to check your open call for success.