Module::Info::File
my $module = Module::Info::File->new_from_file('path/to/Some/Module.pm');
$mod->name();
$mod->version();
$mod->file();
$mod->inc_dir();
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.
Module::Info, by Mattia Barbon
bin/version.pl
The module cannot handle several package definitions in one file and only uses the first one it encounters.
jonasbn <jonasbn@cpan.org>
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>
To install Module::Info::File, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Info::File
CPAN shell
perl -MCPAN -e shell install Module::Info::File
For more information on module installation, please visit the detailed CPAN module installation guide.