I have worked out a system that allows me to maintain breakpoints in the Perl debugger from session to session and load them up next time I run the debugger:

First, I create a ~/.perldb file that contains:

## -*- cperl -*- sub afterinit { use Cwd; my $dbg = getcwd(). "/.perldb"; print "$dbg...\n"; if ( -e $dbg ) { no strict; do $dbg; } }

Then I create a local .perldb file in the current working directory where I run  perl -d:

## -*- cperl -*- push @DB::typeahead, 'f Some.pm', 'b 75', 'f bin/mymainscript', 'b 180', 'b 192', 'L';

So, my questions are:

1) Is this technique widely enough known that I would look like an idiot for blogging about it?

2) Is the usage of @DB::typeahead unsafe in that it's a direct tap into the DB module that may be changed and, therefore, should not be promoted?

Thank you.

In reply to Perl debugging initialization: did I just reinvent the wheel? by mpersico

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.