Just another Perl shrine | |
PerlMonks |
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 ( [id://480074]=note: print w/replies, xml ) | Need Help?? |
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.)
(Those squigglies before the paged output and the 39% at the bottom are courtesy of my default pager, /usr/bin/less.) 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.
In <5> I change the pager option from its default '|$ENV{PAGER}' (where, in your typical halfway civilized Unix system, PAGER is an environment variable that holds one's default pager), to '>> /tmp/capture'. This means that the output of debugger commands prepended by | (in this case, those on <6> and <7>) will now be appended to the file /tmp/capture. In <8> I restore the original value of pager. the lowliest monk
In Section
Seekers of Perl Wisdom
|
|