Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

perl breakpoints



Brian Medley <bpm-list-blu at 4321.tv> writes:

> I am trying to store breakpoints in the perl debugger's rc file.  I have
> found a way to do this, but I am curious if anyone knows a better way (as
> in, officially supported - I don't know if what I came up just "happens" to
> work or if it's what they want done in this situation).
> 
> As shown below, I would like the ability to set a breakpoint for mulitple
> files.
> 
> sub afterinit {
>     $postponed_file{"../lib/Package.pm"}{26} = 1;
>     $postponed_file{"main.pl"}{55} = 1;
> }

Instead of this, I'd recommend just putting the following code snippet
on the lines that you want the breakpoint to exist at:

        $DB::single = 1;

This will cause a break to happen if you're running under the
debugger. 

This is a lot less brittle than hardcoding line numbers.  Also, this
code is harmless if you aren't running underneath the debugger.

Hope this helps,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org