Call graph analysis of perl source?

R

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

Ben Morrow

Quoth Roy Smith said:
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
 
M

Mark Clements

Roy said:
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
 
R

Roy Smith

Mark Clements said:
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.
 
X

xhoster

Roy Smith said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top