Call graph analysis of perl source?

Discussion in 'Perl Misc' started by Roy Smith, Nov 14, 2006.

  1. Roy Smith

    Roy Smith Guest

    I have been given the "interesting" task of figuring out and documenting
    16,000 lines perl. It's typical crud -- no comments, lots of global
    variables, etc.

    After poking at it for a while, it's obvious that what I need to do is
    build a call graph. Are there any tools to help me do this?
     
    Roy Smith, Nov 14, 2006
    #1
    1. Advertising

  2. Roy Smith

    Ben Morrow Guest

    Quoth Roy Smith <>:
    > I have been given the "interesting" task of figuring out and documenting
    > 16,000 lines perl. It's typical crud -- no comments, lots of global
    > variables, etc.
    >
    > After poking at it for a while, it's obvious that what I need to do is
    > build a call graph. Are there any tools to help me do this?


    B::Xref

    Ben

    --
    Many users now operate their own computers day in and day out on various
    applications without ever writing a program. Indeed, many of these users
    cannot write new programs for their machines...
    -- F.P. Brooks, 'No Silver Bullet', 1987 []
     
    Ben Morrow, Nov 14, 2006
    #2
    1. Advertising

  3. Roy Smith wrote:
    > I have been given the "interesting" task of figuring out and documenting
    > 16,000 lines perl. It's typical crud -- no comments, lots of global
    > variables, etc.
    >
    > After poking at it for a while, it's obvious that what I need to do is
    > build a call graph. Are there any tools to help me do this?


    Devel::Graph ? May be a little verbose for your needs.

    I've had good results with Autodia, but this builds graphs of a class
    hierarchy rather than calls themselves.

    Your next task will probably be refactoring: in order to do this
    successfully you'll need to have automatic testing in place. Even an
    application that wasn't designed for testing can be tested to some
    degree at the top level using something like Test::WWW::Mechanize (if
    it's a web application). If you have a well-designed barrage of
    automatic tests you can be more certain (OK - less uncertain) that your
    refactoring hasn't broken anything.

    Mark
     
    Mark Clements, Nov 14, 2006
    #3
  4. Roy Smith

    Roy Smith Guest

    In article <45598d60$0$5069$>,
    Mark Clements <> wrote:

    > Roy Smith wrote:
    > > I have been given the "interesting" task of figuring out and documenting
    > > 16,000 lines perl. It's typical crud -- no comments, lots of global
    > > variables, etc.
    > >
    > > After poking at it for a while, it's obvious that what I need to do is
    > > build a call graph. Are there any tools to help me do this?

    >
    > Devel::Graph ? May be a little verbose for your needs.


    Thanks for the pointer. I just looked at Devel::Graph, and I don't think
    it's what I want. I meant "graph" in the data structure sense of the word,
    not in the pretty pictures sense.

    However, the docs for Devel::Graph contained a pointer to PPI, which does
    look interesting.
     
    Roy Smith, Nov 14, 2006
    #4
  5. Roy Smith

    Guest

    Roy Smith <> wrote:
    > I have been given the "interesting" task of figuring out and documenting
    > 16,000 lines perl. It's typical crud -- no comments, lots of global
    > variables, etc.
    >
    > After poking at it for a while, it's obvious that what I need to do is
    > build a call graph. Are there any tools to help me do this?


    dprofpp -T (and friends)

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Nov 14, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xing Xu

    About extract call graph from C source code

    Xing Xu, Jan 14, 2004, in forum: C Programming
    Replies:
    6
    Views:
    6,653
    James Antill
    Jan 17, 2004
  2. George Sakkis
    Replies:
    1
    Views:
    457
    Szabolcs Nagy
    Jan 29, 2007
  3. ssubbarayan
    Replies:
    5
    Views:
    2,336
    Dave Hansen
    Nov 3, 2009
  4. Emilio Mayorga
    Replies:
    6
    Views:
    341
    Martien Verbruggen
    Oct 8, 2003
  5. IRR
    Replies:
    2
    Views:
    404
Loading...

Share This Page