.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Module::Info::File 3" .TH Module::Info::File 3 "2008-01-07" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Module::Info::File \- retrieves module information from a file or script .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Module::Info::File; .Ve .PP .Vb 1 \& my $module = Module::Info::File->new_from_file('path/to/Some/Module.pm'); .Ve .PP .Vb 1 \& $mod->name(); .Ve .PP .Vb 1 \& $mod->version(); .Ve .PP .Vb 1 \& $mod->file(); .Ve .PP .Vb 1 \& $mod->inc_dir(); .Ve .SH "VERSION" .IX Header "VERSION" This \s-1POD\s0 describes version 0.11 of Module::Info::File .SH "DESCRIPTION" .IX Header "DESCRIPTION" Module::Info (\s-1SEE\s0 \s-1REFERENCES\s0), 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 \fBnew_from_file\fR 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. .PP In the bin folder in this distribution is a small script called version.pl, which was the beginning of everything. .SH "SUBROUTINES/METHODS" .IX Header "SUBROUTINES/METHODS" .Sh "new_from_file" .IX Subsection "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. .PP After construction has been completed three attributes have been set in the object: .IP "* name" 4 .IX Item "name" .PD 0 .IP "* dir" 4 .IX Item "dir" .IP "* file" 4 .IX Item "file" .PD .PP So by using the inherited methods from \fBModule::Info\fR you can access the attributes. .PP There is an example in the bin/ folder called version.pl, this script was the starting point for this module. .IP "* name, returns the package name of the file." 4 .IX Item "name, returns the package name of the file." .PD 0 .IP "* version, returns the version number of the module/file in question ($VERSION)." 4 .IX Item "version, returns the version number of the module/file in question ($VERSION)." .IP "* inc_dir, returns the dir attribute" 4 .IX Item "inc_dir, returns the dir attribute" .IP "* file, returns the file attribute" 4 .IX Item "file, returns the file attribute" .PD .Sh "new_from_data" .IX Subsection "new_from_data" A helper method to streamline the result set .PP In general please refer to the documentation on \fBModule::Info\fR for more details. .PP 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 (\s-1SEE:\s0 \s-1CAVEATS\s0). .PP 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. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "* Module::Info, by Mattia Barbon" 4 .IX Item "Module::Info, by Mattia Barbon" .PD 0 .IP "* bin/version.pl" 4 .IX Item "bin/version.pl" .PD .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" The module can somewhat handle several package definitions in one file, but the information is not complete yet, such as version information etc. .PP The method currently only support the following version number lines: .PP .Vb 1 \& $VERSION = '0.01'; .Ve .PP .Vb 1 \& $VERSION = 0.01; .Ve .SH "INCOMPATIBILITIES" .IX Header "INCOMPATIBILITIES" Eric D. Paterson scanned his complete \s-1CPAN\s0 installation and got and came across a few problems: .IP "DBD::Oracle, the package was defined in a closure, this is handled from Module::Info::File 0.09." 4 .IX Item "DBD::Oracle, the package was defined in a closure, this is handled from Module::Info::File 0.09." .PD 0 .IP "Archive::Zip::Tree, which is installed, however deprecated and does \s-1NOT\s0 contain a package defition." 4 .IX Item "Archive::Zip::Tree, which is installed, however deprecated and does NOT contain a package defition." .IP "CGI::Apache, where the installed version was located in CGI/apache.pm 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." 4 .IX Item "CGI::Apache, where the installed version was located in CGI/apache.pm 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." .PD .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .IP "* Unable to open file: \- " 4 .IX Item "Unable to open file: - " If the constructor \fBnew_from_file\fR is given a filename parameter, which does not meet the following prerequisites: .RS 4 .IP "* it must be a file and it must exist" 4 .IX Item "it must be a file and it must exist" .PD 0 .IP "* the file must be readable by the user" 4 .IX Item "the file must be readable by the user" .RE .RS 4 .RE .PD .SH "CONFIGURATION AND ENVIRONMENT" .IX Header "CONFIGURATION AND ENVIRONMENT" There is a such no configuration necessary and Module::Info::File is expected to work on the same environments as perl itself. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" This module is a sub-class of Module::Info, so the following direct dependencies have to be met: .IP "Module::Info 0.20" 4 .IX Item "Module::Info 0.20" .PD 0 .IP "File::Spec, to work on non-unix operating systems" 4 .IX Item "File::Spec, to work on non-unix operating systems" .IP "Perl 5.6.0 and above" 4 .IX Item "Perl 5.6.0 and above" .PD Compability for older perls is no longer required, if somebody would require this I would be willing to invest the time and effort. .SH "TODO" .IX Header "TODO" .IP "* Use \s-1PPI\s0 for parsing instead of own parsing mechanisms or it this serious overkill?" 4 .IX Item "Use PPI for parsing instead of own parsing mechanisms or it this serious overkill?" .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" In no particular order .IP "\(bu" 4 Jeffrey Ryan Thalhammer, for Perl::Critic .IP "\(bu" 4 chromatic, for Test::Kwalitee .IP "\(bu" 4 Eric D. Peterson, for reporting bugs resulting in an improvement .IP "\(bu" 4 Lars Thegler. tagg (\s-1LTHEGLER\s0), for not letting me go easily, a patch and suggesting the list context variation. .IP "\(bu" 4 Thomas Eibner (\s-1THOMAS\s0), for reviewing the \s-1POD\s0 .IP "\(bu" 4 Mattia Barbon (\s-1MBARBON\s0), for writing Module::Info .IP "\(bu" 4 bigj at Perlmonks who mentioned Module::Info .IP "\(bu" 4 All the \s-1CPAN\s0 testers, who help you to have your stuff tested on platforms not necessarily available to a module author. .SH "AUTHOR" .IX Header "AUTHOR" jonasbn .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Module::Info::File and related modules are free software and is released under the Artistic License. See for details. .PP Module::Info::File is (C) 2003\-2007 Jonas B. Nielsen (jonasbn)