http://qs1969.pair.com?node_id=792770


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:

sub DB::new_eval { local $DB::onetimeDump = 'dump'; &DB::old_eval(@_); + } *DB::old_eval = \&DB::eval; *DB::eval = \&DB::new_eval;
It's perldb.ini if you're on Windows. You get output like this:
[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>
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:
DB<4> print "my father plays dominos\n" my father plays dominos 0 1 DB<5>
but should basically do what you're looking for. You'd need to patch up the dumping function a little more for perfection.