I think your 'R' usage is quite handy. Here's another approach that can sometimes be useful:

% echo 'sub afterinit { $DB::single = 1 }' >> .perldb

That changes the Perl debugger's default to instead stop before running anything. See:

% cat .perldb sub afterinit { $DB::single = 1 } % cat debugMod.pl use LWP::UserAgent; warn "Done"; % perl -d debugMod.pl Loading DB routines from perl5db.pl version 1.33 ... main::CODE(0x43050c)(debugMod.pl:1): 1: use LWP::UserAgent; DB<1> s LWP::UserAgent::CODE(0x26c274c)(.../lib/LWP/UserAgent.pm:3): 3: use strict; DB<1> T $ = LWP::UserAgent::BEGIN() called from file `.../lib/LWP/UserAgent.pm +' line 3 $ = eval {...} called from file `.../lib/LWP/UserAgent.pm' line 3 $ = require 'LWP/UserAgent.pm' called from file `debugMod.pl' line 1 $ = main::BEGIN() called from ... $ = eval {...} called from ... DB<1>

Skipping over the loading of modules can be a pain, so I wouldn't recommend leaving this particular .perldb in place most of the time.

(FYI, I couldn't get this to work under Windows w/o first fixing some bugs in perl5db.pl or else I'd show how the file has to be named perldb.ini and other required differences there.)

- tye        


In reply to Re: Using the debugger's R command to debug "hard" problems (.perldb) by tye
in thread Using the debugger's R command to debug "hard" problems by pemungkah

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.