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. | [reply] [d/l] |
Are you on Windows or NT? If you are on NT then you are in
luck. Just right-click at the bar across the top of the
DOS window, select edit, then mark. Mark with your mouse
and hit return. Alternately hold alt, hit space, and then
hot-key through the same motions. (You can do the same to
paste.)
One either you can redirect the output to a file (either by
opening a filehandle or with > at the command prompt) and
then open in notepad. If you want you can even launch
notepad from Perl with a system command.
And another neat trick, there is a module called
Win32::Clipboard that you can use. Have Perl collect all
of the output in a single string, and then paste that to
the clipboard, from which you can paste anywhere you
want.
I may not be the biggest fan of Windows in the world, but
I have learned a few tricks and there is no need to be any
more miserable while using it than necessary... :-) | [reply] |