in reply to Re^2: foreach in HoHoA problems
in thread foreach in HoHoA problems

D'oh!

man perldebug helped. I've been using the 's' key to step through my code line by line. I didn't realize I should use the 'r' key on the subroutine that did the 450 Mb file search.

Phew!. Much better. Debugging is going to go a whole lot faster now....

Matt

Replies are listed 'Best First'.
Re^4: foreach in HoHoA problems
by graff (Chancellor) on Oct 28, 2006 at 21:41 UTC
    Just using "b" (set breakpoint) and "B" (delete breakpoint) will also save you tons of debugging time: you provide a line number or a subname (e.g. "b 384" or "b bigsub"), and you can even add a condition (e.g. "b 384 (!defined $hit)". I often set a bunch of breakpoints before starting a script that has a set of "interesting" branches.

    Then do "c" (continue), and it will stop if/when it gets to any breakpoint. If the script has "use Data::Dumper", you can do "p dumper( $ref_variable )" to see how (some portion of) your data structure looks at that point.

    And that is just the tip of the iceberg.