package Class::InheritanceTree;

use warnings;

use Tree::Simple;

##############################
##############################
sub tree {
  my ($class, $class_name) = @_;

  eval("use $class_name");
  
  my $tree = Tree::Simple->new($class_name);
  
  my $s = "${class_name}::ISA";
  my @isa = @$s;

  foreach my $super (@isa) {
    $tree->addChild(__PACKAGE__->tree($super));
  }
  
  return $tree;
}

##############################
##############################
1;

=pod

=head1 Class::InheritanceTree

=cut