Re: How do I get output from the perl debugger (perl -d) into a text file?
by Taulmarill (Deacon) on Aug 01, 2005 at 12:33 UTC
|
if you are on a unix machine, something like perl -d myprogram.pl | tee logfile.log writes the output from perl into the logfile, but not your input.
maybe that helps. | [reply] |
|
|
| [reply] |
|
|
I'd recommend the unix 'script' command, but be warned -- it will also save control characters, which makes for some interesting reading if you try to pop it open in your favorite text editor.
You can clean up a script file using the unix command 'col'.
You can also use logging in your terminal program (tf or similar, if your current terminal doesn't support that function) or use something like 'screen'.
Update: For those who aren't aware, windows users can make use of unix commands via programs like cygwin. Another useful command.com replacement is 4DOS and its siblings.
| [reply] |
|
|
Re: How do I get output from the perl debugger (perl -d) into a text file?
by marto (Cardinal) on Aug 01, 2005 at 13:26 UTC
|
The OP has stated that they are having to scroll up a DOS window. perlman:perldebug may help. See if you can set LineInfo to a file in the initialization options, something like:
&parse_options("NonStop=1 LineInfo=db.out AutoTrace");
Hope this helps.
Martin | [reply] [d/l] |
Re: How do I get output from the perl debugger (perl -d) into a text file?
by QM (Parson) on Aug 01, 2005 at 13:44 UTC
|
...rather than scrolling up and down in this ugly dos window?
Have you changed the properties on your DOS window?
Under later Windoze versions, you can change the window width and height (in characters), the buffer width and height, and make this permanent for every DOS window you open. The mouse wheel also works for scrolling.
Do you know how to copy/paste? (Some of my co-workers find it frustrating that it's not ^C/^P.)
-QM
--
Quantum Mechanics: The dreams stuff is made of
| [reply] |
|
|
| [reply] |
|
|
Yes, well, that's the old way. I wasn't asking for myself, but rather asking if the OP had trouble with that as well.
My favored method is to turn on Quick Edit, mark a rectangle with the mouse, and hit Enter/Return to copy. The right (secondary) mouse button pastes in the DOS window, or Ctrl-V in a Windoze window.
-QM
--
Quantum Mechanics: The dreams stuff is made of
| [reply] |
Re: How do I get output from the perl debugger (perl -d) into a text file?
by tlm (Prior) on Aug 02, 2005 at 04:00 UTC
|
Two ideas that have not been mentioned (but may only work on Unix) are the following. You can prepend a pipe symbol | before debugger commands to get paged output. (I have heard that H. redmondiensis knows about the wheel and the inclined plane, so maybe he also knows about pagers.)
In fact, though this is the default behavior when one prepends a | to commands, you can customize this significantly, to tell the debugger where to send its output.
| [reply] [d/l] [select] |