Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  MODULE::INFO::FILE (3)

.ds Aq ’


Module::Info::File - retrieve module information from a file



This POD describes version 0.13 of Module::Info::File


        use Module::Info::File;

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






Module::Info (SEE REFERENCES), are lacking functionality of being able to extract certain data when parsing a module directly from a file. I have therefor created Module::Info::File, which inherits from Module::Info and replaces the <B>new_from_fileB> method so the lacking data can be accessed (dir and name attributes). Apart from that you can use all the neat accessors from Module::Info.

In the bin folder in this distribution is a small script called, which was the beginning of everything.



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:
o name
o dir
o file
So by using the inherited methods from <B>Module::InfoB> you can access the attributes.

There is an example in the bin/ folder called, this script was the starting point for this module.
o name, returns the package name of the file.
o version, returns the version number of the module/file in question ($VERSION).
o inc_dir, returns the dir attribute
o file, returns the file attribute


A helper method to streamline the result set

In general please refer to the documentation on <B>Module::InfoB> for more details.

In list context the module returns and array of Module::Info::File objects, with which you can use the above accessors. The information in the objects might not be complete though (SEE: CAVEATS).

In the t/ directory of this distribution there is a test (Info.t), it includes some tests. These tests will test your installation of Module::Info (required by Module::Info::File), if the tests fail, Module::Info::File will be obsolete and can be discontinued.


o Module::Info, by Mattia Barbon
o bin/


The module can somewhat handle several package definitions in one file, but the information is not complete yet, such as version information etc.

The method currently only support the following version number lines:

        $VERSION = 0.01;

        $VERSION = 0.01;


Eric D. Paterson scanned his complete CPAN installation and got and came across a few problems:
DBD::Oracle, the package was defined in a closure, this is handled from Module::Info::File 0.09.
Archive::Zip::Tree, which is installed, however deprecated and does NOT contain a package defition.
CGI::Apache, where the installed version was located in CGI/ so the casing was not uniform with the package definition, I have asked Eric for further information on this issue, regarding his version and installation.


o Unable to open file: <filename> - <operating system error>

If the constructor <B>new_from_fileB> is given a filename parameter, which does not meet the following prerequisites:
o it must be a file and it must exist
o the file must be readable by the user


There is a such no configuration necessary and Module::Info::File is expected to work on the same environments as perl itself.


This module is a sub-class of Module::Info, so the following direct dependencies have to be met:
Module::Info 0.20
File::Spec, to work on non-unix operating systems
Perl 5.6.0 and above Compability for older perls is no longer required, if somebody would require this I would be willing to invest the time and effort.


o Use PPI for parsing instead of own parsing mechanisms or it this serious overkill?


In no particular order
o Jeffrey Ryan Thalhammer, for Perl::Critic
o chromatic, for Test::Kwalitee
o Eric D. Peterson, for reporting bugs resulting in an improvement
o Lars Thegler. tagg (LTHEGLER), for not letting me go easily, a patch and suggesting the list context variation.
o Thomas Eibner (THOMAS), for reviewing the POD
o Mattia Barbon (MBARBON), for writing Module::Info
o bigj at Perlmonks who mentioned Module::Info
o All the CPAN testers, who help you to have your stuff tested on platforms not necessarily available to a module author.


jonasbn <>


Module::Info::File and related modules are free software and is released under the Artistic License 2.0.

Module::Info::File is (C) 2003-2014 Jonas B. Nielsen (jonasbn) <>

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 MODULE::INFO::FILE (3) 2014-08-27

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.