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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.