Robert Kiesling > Lib-Module-0.69 > Lib::Module

Download:
Lib-Module-0.69.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.69   Source   Latest Release: Lib-Module-0.7

Lib::Module.pm - Perl library module utilities. ^

SYNOPSIS ^

  use Lib::Module;

  my $m = new Lib::Module;  # Create a module object.

  # Create the class library hierarchy.
  $m -> libdirs ($verbose); 
  $m -> module_paths ($verbose);
  $m -> scanlibs ($verbose);

  # Retrieve the module object for a package.
  my $m2 = $m -> retrieve ("Tk::Browser");

  print $m2 -> PathName . "\n" . 
        $m2 -> BaseName . "\n" .
        $m2 -> PackageName . "\n" .
        $m2 -> ModuleVersion . "\n" .
        $m2 -> Supers . "\n";

  # Return the file path name of a module.
  my $path = $m -> pathname ("Tk::Browser");

DESCRIPTION ^

A Lib::Module object describes a Perl library module and includes the module's package name, file name, version, and superclasses, if any.

The module objects are normally part of a class hierarchy generated by libdirs (), module_paths (), and scanlibs (). Every module is a subclass of UNIVERSAL, Perl's default superclass.

METHODS ^

ModuleVersion

Return the module's b<$VERSION => line.

PathName ($name)

Return the module's path.

BaseName ($name)

Return the module's file basename.

PackageName ($name)

Return the argument of the module's package function.

retrieve (basename || packagename)

The retrieve ($name) method returns the Lib::Module object or undef.

  my $new = $m -> retrieve ("Optional::Module");

  if (!defined $new) {
     print "Can't find Optional::Module.\n"
  }

Retrieve matches the first part of the module's name. If retrieve doesn't match a sub-module, specify only the sub-module's name; e.g., 'Module' instead of 'Optional::Module'.

Supers ()

Returns the module's superclasses; i.e, the arguments of an @ISA declaration.

EXPORTS ^

See the @EXPORTS_OK array.

BUGS ^

Does not take into account all of the possible module naming schemes when retrieving modules.

VERSION ^

VERSION 0.69

COPYRIGHT ^

Copyright © 2001-2004 Robert Kiesling, rkies@cpan.org.

Licensed under the same terms as Perl. Refer to the file, "Artistic," for information.

SEE ALSO ^

perl(1), Tk::Browser(3)

syntax highlighting: