Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
To figure out what programs are doing, I used B::Xref and some wrapper scripts to generate a call tree for code written in a procedural manner.

You might developing something along those lines yourself (since I foolishly wrote my program at work, it is,of course, copyright by my company, so I can't post code for you).

Learn to use the perl debugger: it's handy. It will let you execute arbitrary perl code to see what it does, single step through functions, stop at certain lines, and so forth. While you just can't "go back" to a previously executed line in the debugger, you can often just copy the line, and single step through it. This is most useful for function calls that have gone awry.

eg. Suppose the line $x = foo($y) returns the wrong thing. Just type s foo($y) into the debugger, and single step through foo() until you find the call in foo() that's wrong, say bar(). Then single step through bar(), and so on. Keep chasing your way down the call stack until you find the bug.

The debugger certainly doesn't default to printing each subroutine that's called, but it can be made to do it by writing some custom debugging code. There may be CPAN modules that will do this for you, as well.

Do a 'perldoc perldebug' for the standard debugger documentation; do 'perldoc perldebguts' to learn how to reprogram the internals of the perl debugger to make it do other useful things.
--
Ytrew Q. Uiop


In reply to Re: Becoming familiar with a too-big codebase? by Anonymous Monk
in thread Becoming familiar with a too-big codebase? by aboyd

Title:
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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-24 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found