The perl debugger is very poorly documented, but it's quite useful.
Unlike ad-hoc trace statements, you don't risk introducing bugs by modifying your code. You also don't have to remember to take *out* all your trace statements again: the code is only modified to fix bugs or add features.
You can toss breakpoints in to test branches, examine variables, or change them to see if fixing the data fixes the bug you're encountering. You can quickly examine complex data structures to see if the data you're looking for is in there: or if there's any data at all.
You can't go backwards, which is frustrating, but you *can* step through an arbitrary function as it executes, which is almost as good. That means that if you have a function with no side effects, you can run through the code, find the function call that is wrong, and then single step through the function looking for why it's wrong, without re-rerunning the program. Re-running the program can be tedious, if the program runs slowly, or has a long start up time.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||