Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2023-03-23 21:06 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.