Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
In addition to what tilly says, why not just break on the line that contains '&$function($arg1, $arg2)' and then step to the next statement and see where it goes. Which brings me to why I've forced myself to learn the debugger (with which I am now mediocre). merlyn says just don't put bugs in your code, and write small bits of code that work, which is great when you're writing your own code.

When you're maintaining someone elses 3000+ line (not including modules) spaghetti code that uses neither strict nor warnings, and you're wondering how the program got from point A to point B and how some global variable seemed to get magically populated (by some module C), to me there's nothing like a decent debugger to trace the (@#$@#!!) damn thing. And sometimes I don't want to put in print statements to see what "$a" is at point A, because then I just have to remove (or comment out) the print statement later, or by the time I get to point A, I find that I really wanted to see what "$b" was, and with a debugger I can do that without restarting the whole program.

I've worked with other programmers (in another language, 4gl if you must know) that couldn't use a debugger, and stared at a problem for days wondering what was going on, when with the help of the debugger the problem was found (in some deep dark library) in an hour or two.

I think that the only thing (that I can think of at the moment) that the perl debugger needs is the ability to save break points and/or accept some input script (like break at line 100; step 1 line (requiring some module), then break at some function in that module if $i > 54). If someone knows how to do this, please let me know :)

In reply to Re: How to debug unknown dynamic code? by runrig
in thread How to debug unknown dynamic code? by gaspodethewonderdog

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!
  • 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, 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
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (10)
    As of 2014-12-26 19:44 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (174 votes), past polls