NAME
prereq-grapher - generate dependency graph for perl module or source
SYNOPSIS
prereq-grapher [options] Foo::Bar .. Foo::Baz
Options:
-o <file> The file to write the graph into
-dot Generate graph in dot format (used by GraphViz)
-svg Generate graph as Scalable Vector Graphics
-html Generate graph as HTML
-gml Generate graph as GraphML
-vcg Generate graph in VCG format
DESCRIPTION
prereq-grapher parses perl source and looks for prerequisites, such as modules that are use
'd or require
'd. All of those modules are then parsed in turn, looking for their dependencies.
Once all files have been parsed, prereq-grapher will write out the dependency graph in one of the five formats supported.
The simplest way to run prereq-grapher is just giving a module name:
% prereq-grapher Module::Path
6 modules processed. Graph written to dependencies.dot
By default prereq-grapher generates the dependency graph in dot
format, and writes it to a file called dependencies.dot
. You can explicitly specify the output format and filename:
% prereq-grapher -svg -o class-inspector-path.svg Class::Inspector
9 modules processed. Graph written to class-inspector.svg
OPTIONS
- -o <file> | -output-file <file>
-
The name of the file that the dependency graph should be written to. If not specified, prereq-grapher will write the graph in a file called
dependencies
, and the extension will indicate the format (dot, svg, html, gml, or vcg). - -dot
-
Generate the dependency graph in the Dot format supported by the GraphViz tools.
- -svg
-
Generate the dependency graph as Scalable Vector Graphics.
- -html
-
Generate the dependency graph as an HTML file with embedded CSS. Note: I haven't got this to work yet, but it's one of the output formats supported by Graph::Easy.
SEE ALSO
For the dot format, see http://www.graphviz.org. There are graphical tools for viewing direct graphs, or you can use the dot
program on the command-line to generate an image, postscript, or many other things besides.
For SVG, you could look at the W3C page on SVG, but probably more useful is the Wikipedia page on SVG.
For GraphML (the gml export format), see <the GraphML home page|http://graphml.graphdrawing.org>.
I haven't been able to get the HTML version to work for any dependency graph I've tried.
For VCG, see The VCG home page.
The functionality for prereq-grapher is provided by App::PrereqGrapher, which in turn builds on Perl::PrereqScanner and Graph::Easy.
AUTHOR
Neil Bowers <neilb@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Neil Bowers.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.