There's nothing to say you can't do a hybrid approach if you're debugger is being annoying... which the perl debugger is sometimes. :-(
Add a debugging conditional for the nth line of the loop, and set a breakpoint at it.
In my experience, though, if I'm interested in the thousandth interation of something, there's something happening (a particular record, or database entry, or something) that triggers my interest in the 1,000th time through the loop versus the 999th time.
If I can identify what that is, I can write debug code to detect the suspicious condition, and set a breakpoint for that. Then I can decide what to print out, and where to investigate from there.
Unfortunately, the perl debugger doesn't seem to have a "detect this condition and break" function, and I sure wish it did. I consider it a flaw in the debugger when I have to write debug code by hand, but it's better than writing *all* the debug code by hand, only to tear it *all* out later... | [reply] [Watch: Dir/Any] |
b My::App::some_function $_[3] > 999
Sets the breakpoint on My::App::some_function only if the 4th argument is numerically larger than 999. Similar structure for line breaks:
b 215 $i > 999
I use it all the time. It's invaluable. | [reply] [Watch: Dir/Any] [d/l] [select] |
| [reply] [Watch: Dir/Any] |