in reply to Re^4: [perldebugger] calling perldoc from within the debugger (inifile)
in thread [perldebugger] calling perldoc from within the debugger
Hm. Might be able to do it by altering sub eval() ... yes, quite easily!
Setting $DB::onetimeDump to 'dump' and calling DB::eval will do exactly what you want. Try this in your .perldb:
It's perldb.ini if you're on Windows. You get output like this:sub DB::new_eval { local $DB::onetimeDump = 'dump'; &DB::old_eval(@_); + } *DB::old_eval = \&DB::eval; *DB::eval = \&DB::new_eval;
This is just copying the old eval to a new name, creating a new sub that calls it after setting up $onetimeDump property, and substituting the new sub for the old one. it's not perfect:[tearought-lm|(none)]04:54 PM $ perl -de0 Loading DB routines from perl5db.pl version 1.31 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> [1..10] 0 ARRAY(0x800cc0) 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 DB<2>
but should basically do what you're looking for. You'd need to patch up the dumping function a little more for perfection.DB<4> print "my father plays dominos\n" my father plays dominos 0 1 DB<5>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: [perldebugger] calling perldoc from within the debugger (REPL) (THX!)
by LanX (Saint) on Sep 02, 2009 at 23:02 UTC | |
by pemungkah (Priest) on Sep 03, 2009 at 17:22 UTC | |
Re^6: [perldebugger] calling perldoc from within the debugger (REPL)
by LanX (Saint) on Feb 02, 2012 at 00:17 UTC | |
by pemungkah (Priest) on Feb 12, 2012 at 21:38 UTC |
In Section
Seekers of Perl Wisdom