Renée Bäcker > Class-Superclasses-0.06 > Class::Superclasses

Download:
Class-Superclasses-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Class::Superclasses - Find all (direct) superclasses of a class

DESCRIPTION

Class::Superclasses uses PPI to get the superclasses of a class;

SYNOPSIS ^

  use Class::Superclasses;
  
  my $class_file = '/path/to/class_file.pm';
  my $parser = Class::Superclasses->new();
  $parser->document($class_file);
  my @superclasses = $parser->superclasses();
  
  print $_,"\n" for(@superclasses);

METHODS ^

new

creates a new object of Class::Superclasses.

  my $parser = Class::Superclasses->new();
  # or
  my $parser = Class::Superclasses->new($filename);

superclasses

returns in list context an array of all superclasses of the Perl class, in scalar context it returns an arrayref.

  my $arrayref = $parser->superclasses();
  my @array = $parser->superclasses();

document

tells Class::Superclasses which Perl class should be analyzed.

  $parser->document($filename);
syntax highlighting: