in reply to Using debugger breakpoints in Test::Class code

Why don't you want to add the $DB::single line?

At work we have a key-binding in our editor that drops these two lines at the cursor:

local $MY::var = 1; # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX $DB::single = 1 if $MY::var; # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
When debugging code, we'll generally drop the $MY::var = 1 line into some test block, and stick the $DB::single line into whatever method we're debugging. Works fine.

Replies are listed 'Best First'.
Re^2: Using debugger breakpoints in Test::Class code
by secondturtle (Initiate) on Nov 14, 2008 at 17:00 UTC

    > Why don't you want to add the $DB::single line?
    For all the same reasons the debugger supports adding breakpoints while debugging.

    Also, many times when I'm debugging is when I decide where I want to add a breakpoint. I don't want to have to restart the debugger and lose my position in the executing program's call stack just to add a break point. That's annoying.

    Adding a $DB::single=1 code works, but it's far from ideal.