You may find it useful to see the information available by doing:

perldoc perldebug

Unless I am misunderstanding you, then using the debugger is pretty straightforward. So, for example, if you want to debug a program from the command line, you'd simply do:

perl -d program_name

... and then you can step through each line using the letter "n" (or you can just hit enter, after you've hit "n" the first time). If you want to go into a sub-routine then you type "s" instead of "n", when you get to that line (and then do "n" again once you're in there). To show line numbers when you're debugging you can just scroll through using the letter "l". Using "l" doesn't execute code, it just lists it; so, when you're done with listing it you can just carry on from where you were with an "n". If you want to break on a specific line number then, once you've started the program in debug mode you can just type in "b 99" (for example), where "99" is the line number. Then just type in "c" to continue the program. It will continue without intervention until/if it reaches the breakpoint. Once you get familiar with it you can also break on conditions too, such as when a variable =xyz.

Does that help?


In reply to Re: How perl debugger breakpoint works? by DanielSpaniel
in thread How perl debugger breakpoint works? by PerlOnTheWay

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.