GraphViz2::Parse::ISA can visualize N Perl class hierarchies as a graph.

I used the code from the synopsys on the files that come with the distribution:

Installed the module:

cpanm GraphViz2::Parse::ISA

Then also downloaded the source separately and unzipped it.

tar xzf GraphViz2-Parse-ISA-2.52.tar.gz
cd GraphViz2-Parse-ISA-2.52

Then created a file which was a copy of the code from the synopsis in the documentation of GraphViz2::Parse::ISA.

It did not work out of the box, but after I made some small changes (commented out 2 lines and added one on line 28) it generated a file called parse.code.svg based on the files in the t/lib directory of the zip file.


#!/usr/bin/env perl
use strict;
use warnings;
use File::Spec;
use GraphViz2;
use GraphViz2::Parse::ISA;
my($graph) = GraphViz2 -> new
         edge   => {color => 'grey'},
         global => {directed => 1},
         graph  => {rankdir => 'BT'},
         node   => {color => 'blue', shape => 'Mrecord'},
my($parser) = GraphViz2::Parse::ISA -> new(graph => $graph);
unshift @INC, 't/lib';
$parser -> add(class => 'Adult::Child::Grandchild', ignore => []);
#$parser -> add(class => 'Hybrid', ignore => []);
$parser -> generate_graph;
my($format)      = shift || 'svg';
#my($output_file) = shift || File::Spec -> catfile('html', "parse.code.$format");
my($output_file) = shift || "parse.code.$format";
$graph -> run(format => $format, output_file => $output_file);

More examples on the Graphviz Perl web site