-----BEGIN PGP SIGNED MESSAGE-----

Moin,

Leon Brocard (hi! :) did some graphing of various Perl things back in 2001
or so. I thought I'd also do something alike[0].

It can be very hard to follow what ends up actually in memory when you 
"use Some::Package;" - especially because that depends on numerous 
factors like Perl version, third-party packages, architecture, etc.

graph-perl-usage is a little script that uses various modules/programs to
generate usage graphs of Perl package. That is, it tracks which package
uses or requires which and puts that into a graph. Recursively, if you
wish so.

Here are two examples for vars.pm for 5.8.6 and blead (as ASCII in this
mail, but you can have HTML/ASCII (for small graphs) or SVG/PNG (via dot):

 # ./gen_graph --recurse=vars --versions --format=ascii

 +--------------------+     +----------+
 | vars               | --> | strict   |
 | v1.01              |     +----------+
 +--------------------+
   |
   |
   v
 +--------------------+     +----------+     +-------+     +----------+
 | warnings::register | --> | warnings | --> | Carp  | --> | Exporter |
 | v1.00              |     | v1.03    |     | v1.03 |     | v5.58    |
 +--------------------+     +----------+     +-------+     +----------+

 # with --inc=/home/te/src/blead/lib:

 +--------------------+     +----------+
 | vars               | --> | strict   |
 | v1.01              |     +----------+
 +--------------------+
   |
   |
   v
 +--------------------+     +----------+
 | warnings::register | --> | warnings |
 | v1.00              |     | v1.04    |
 +--------------------+     +----------+

Please see: http://bloodgate.com/perl/graph/usage/ for the details and
more examples, including nifty images.

The heuristic to detect use/require might be a bit fuzzy, and there might
be bugs or roam for improvement. In any way, I'd like feedback. :o)

Have fun,

Tels

PS: Yes, you can put the entire (blead or otherwise) Perl source into. It 
take a while and the resulting PNG/SVG is huuge, but it is possible. But 
don't blame me if you go cross-eyed staring at the output :-D

0: Although I couldn't find his actual code/examples/slides, from the
excerpts I gather that Leon did not already do what I did. Hopefully.
Nonetheless, re-inventing the wheel is fun :)

- --
 Signed on Sun Jul 10 14:16:05 2005 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 "I can imagine what you're thinking though: this girl keeps her brains
 in her backside! But actually only the more primitive parts of my brain
 are in my butt. The more interesting parts are kept in a PC - my spinal
 cord is actually an RS232 lead!" - Lucy, the OrangUtan Robot Girl
 http://tinyurl.com/3fv6z

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQEVAwUBQtEXCHcLPEOTuEwVAQGuoAf/R80WYjN6kBVHY9E6Ynhola7wC9IiOP5D
hoeSPia5C59p8cnSI/QlY66MT4YYuPof2G6VZ17mOAS42FRyghhOP0uDLgsOh04j
HB7GQ4JPDUCZYn9lPs1RjgsyFs0GenZUy4MsUp6XVvnOKB2V0uVl+aljGV5WDrku
x6SJDmw+cblGY0ALPwk/8cS6j9+8g2x9+//gdjGjy1ZWrFJGeQzQt4R/L6QP9aLD
ZOf/VD5tH2ua44nPQK12unS0TQ3Z1u/iqgiIfQMAR3FzPBl+6ti8ZmAbzVq3pPpU
fe2Kdb2RdxS8wb7yrINRTfs+jgyUqWWnwv124fFhTv4g1+7yEr0NYw==
=hIJH
-----END PGP SIGNATURE-----

Reply via email to