{"id":18910026,"url":"https://github.com/jonasbn/module-info-file","last_synced_at":"2026-03-07T13:30:19.626Z","repository":{"id":19246078,"uuid":"22481323","full_name":"jonasbn/Module-Info-File","owner":"jonasbn","description":"Retrieve module information from a file containing a Perl module","archived":false,"fork":false,"pushed_at":"2019-09-25T15:49:37.000Z","size":76,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T05:27:20.662Z","etag":null,"topics":["cpan","hacktoberfest","perl"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/Module::Info::File","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonasbn.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-31T19:07:52.000Z","updated_at":"2022-10-01T07:06:57.000Z","dependencies_parsed_at":"2022-08-01T04:07:56.709Z","dependency_job_id":null,"html_url":"https://github.com/jonasbn/Module-Info-File","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2FModule-Info-File","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2FModule-Info-File/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2FModule-Info-File/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2FModule-Info-File/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonasbn","download_url":"https://codeload.github.com/jonasbn/Module-Info-File/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239898462,"owners_count":19715212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpan","hacktoberfest","perl"],"created_at":"2024-11-08T09:38:59.874Z","updated_at":"2026-03-07T13:30:19.563Z","avatar_url":"https://github.com/jonasbn.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CPAN version](https://badge.fury.io/pl/Module-Info-File.svg)](http://badge.fury.io/pl/Module-Info-File)\n[![Build Status](https://travis-ci.org/jonasbn/Module-Info-File.svg?branch=master)](https://travis-ci.org/jonasbn/Module-Info-File)\n[![Coverage Status](https://coveralls.io/repos/jonasbn/Module-Info-File/badge.png)](https://coveralls.io/r/jonasbn/Module-Info-File)\n\n# NAME\n\nModule::Info::File - retrieve module information from a file\n\n# VERSION\n\nThis POD describes version 1.00 of Module::Info::File\n\n# SYNOPSIS\n\n        use Module::Info::File;\n\n        my $module = Module::Info::File-\u003enew_from_file('path/to/Some/Module.pm');\n\n        $module-\u003ename();\n\n        $module-\u003eversion();\n\n        $module-\u003efile();\n\n        $module-\u003einc_dir();\n\n# DESCRIPTION\n\n**Module::Info** (SEE REFERENCES), are lacking functionality of being able\nto extract certain data when parsing a module directly from a file. I\nhave therefor created Module::Info::File, which inherits from\nModule::Info and replaces the **new\\_from\\_file** method so the lacking\ndata can be accessed (dir and name attributes). Apart from that you can\nuse all the neat accessors from **Module::Info**.\n\nGiven the following structure in a file:\n\n    package Foo;\n    1;\n    package Bar;\n    1;\n\n**Module::Info::File** returns: Foo\n\nGiven the following structure in a file:\n\n    package Foo;\n    $VERSION = '0.01';\n    1;\n\n# SUBROUTINES/METHODS\n\n## new\\_from\\_file\n\nGiven a file, it will interpret this as the module you want information\nabout. You can also hand it a perl script.\n\nAfter construction has been completed three attributes have been set in\nthe object:\n\n- name\n- dir\n- file\n\nSo by using the inherited methods from **Module::Info** you can access\nthe attributes.\n\nIn the `script` folder in this distribution is a small script called\n`version.pl`, which was the beginning of this module.\n\n- name, returns the package name of the file.\n- version, returns the version number of the module/file in question\n($VERSION).\n- inc\\_dir, returns the dir attribute\n- file, returns the file attribute\n\n## new\\_from\\_data\n\nA helper method to streamline the result set\n\nIn general please refer to the documentation on **Module::Info** for more\ndetails.\n\nIn list context the module returns and array of Module::Info::File objects, with\nwhich you can use the above accessors. The information in the objects might not\nbe complete though (SEE: CAVEATS).\n\nIn the t/ directory of this distribution there is a test (Info.t), it\nincludes some tests. These tests will test your installation of\nModule::Info (required by Module::Info::File), if the tests fail,\nModule::Info::File will be obsolete and can be discontinued.\n\n# SEE ALSO\n\n- [Module::Info](https://metacpan.org/pod/Module::Info), by Mattia Barbon\n- `script/version.pl`\n\n# BUGS AND LIMITATIONS\n\nThe module can somewhat handle several package definitions in one file, but\nthe information is not complete yet, such as version information etc.\n\nThe method currently only support the following version number lines:\n\n        $VERSION = '0.01';\n\n        $VERSION = 0.01;\n\n# INCOMPATIBILITIES\n\nEric D. Paterson scanned his complete CPAN installation and got and came across\na few problems:\n\n- [DBD::Oracle](https://metacpan.org/pod/DBD::Oracle), the package was defined in a closure, this is handled from\nModule::Info::File 0.09.\n- [Archive::Zip::Tree](https://metacpan.org/pod/Archive::Zip::Tree), which is installed, however deprecated and does NOT\ncontain a package defition.\n- [CGI::Apache](https://metacpan.org/pod/CGI::Apache), where the installed version was located in CGI/apache.pm\nso the casing was not uniform with the package definition, I have asked Eric\nfor further information on this issue, regarding his version and installation.\n\n# DIAGNOSTICS\n\n- `Unable to open file: \u003cfilename\u003e - \u003coperating system error\u003e`\n\n    If the constructor **new\\_from\\_file** is given a filename parameter, which does\n    not meet the following prerequisites:\n\n    - it must be a file and it must exist\n    - the file must be readable by the user\n\n# CONFIGURATION AND ENVIRONMENT\n\nThere is a such no configuration necessary and Module::Info::File is expected\nto work on the same environments as perl itself.\n\n# DEPENDENCIES\n\nThis module is a sub-class of [Module::Info](https://metacpan.org/pod/Module::Info), so the following direct\ndependencies have to be met:\n\n- [Module::Info](https://metacpan.org/pod/Module::Info) 0.20\n- [File::Spec](https://metacpan.org/pod/File::Spec), to work on non-unix operating systems\n- Perl 5.6.0 and above\n\n    Compability for older perls is no longer required, if somebody would\n    require this I would be willing to invest the time and effort.\n\n# ACKNOWLEDGEMENTS\n\nIn no particular order\n\n- Mohammad S Anwar, for PRs #6\n- Dai Okabayashi (bayashi), for PRs #2 and #3\n- Jeffrey Ryan Thalhammer, for [Perl::Critic](https://metacpan.org/pod/Perl::Critic)\n- chromatic, for [Test::Kwalitee](https://metacpan.org/pod/Test::Kwalitee)\n- Eric D. Peterson, for reporting bugs resulting in an improvement\n- Lars Thegler. tagg (LTHEGLER), for not letting me go easily, a patch and\nsuggesting the list context variation.\n- Thomas Eibner (THOMAS), for reviewing the POD\n- Mattia Barbon (MBARBON), for writing Module::Info\n- bigj at Perlmonks who mentioned Module::Info\n- All the CPAN testers, who help you to have your stuff tested on platforms not\nnecessarily available to a module author.\n\n# AUTHOR\n\njonasbn \u003cjonasbn@cpan.org\u003e\n\n# LICENSE AND COPYRIGHT\n\nModule::Info::File and related modules are free software and is\nreleased under the Artistic License 2.0.\n\nModule::Info::File is (C) 2003-2017 Jonas B. Nielsen (jonasbn)\n\u003cjonasbn@cpan.org\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fmodule-info-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasbn%2Fmodule-info-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fmodule-info-file/lists"}