The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Module::Info::File

SYNOPSIS

my $module = Module::Info::File->new_from_file('path/to/Some/Module.pm');

$mod->name();

$mod->version();

$mod->file();

$mod->inc_dir();

DESCRIPTION

new_from_file

Given a file, it will interpret this as the module you want information about. You can also hand it a perl script.

After construction has been completed three attributes have been set in the object:

  • name

  • dir

  • file

So by using the inherited methods from Module::Info you can access the attributes.

There is an example in the bin/ folder called version.pl, this script was the starting point for this module.

  • name, returns the package name of the file.

  • version, returns the version number of the module/file in question ($VERSION).

  • inc_dir, returns the dir attribute

  • file, returns the file attribute

Please refer to the documentation on Module::Info for more details.

SEE ALSO

  • Module::Info, by Mattia Barbon

  • bin/version.pl

CAVEATS

The module cannot handle several package definitions in one file and only uses the first one it encounters.

AUTHOR

jonasbn <jonasbn@cpan.org>

COPYRIGHT

Module::Info::File and related modules are free software and is released under the Artistic License. See <http://www.perl.com/language/misc/Artistic.html> for details.

Module::Info::File is (C) 2003 Jonas B. Nielsen (jonasbn) <jonasbn@cpan.org>