1Module::Metadata(3)   User Contributed Perl Documentation  Module::Metadata(3)
2
3
4

NAME

6       Module::Metadata - Gather package and POD information from perl module
7       files
8

DESCRIPTION

10       new_from_file($filename, collect_pod => 1)
11           Construct a "ModuleInfo" object given the path to a file. Takes an
12           optional argument "collect_pod" which is a boolean that determines
13           whether POD data is collected and stored for reference. POD data is
14           not collected by default. POD headings are always collected.
15
16       new_from_module($module, collect_pod => 1, inc => \@dirs)
17           Construct a "ModuleInfo" object given a module or package name. In
18           addition to accepting the "collect_pod" argument as described
19           above, this method accepts a "inc" argument which is a reference to
20           an array of of directories to search for the module. If none are
21           given, the default is @INC.
22
23       name()
24           Returns the name of the package represented by this module. If
25           there are more than one packages, it makes a best guess based on
26           the filename. If it's a script (i.e. not a *.pm) the package name
27           is 'main'.
28
29       version($package)
30           Returns the version as defined by the $VERSION variable for the
31           package as returned by the "name" method if no arguments are given.
32           If given the name of a package it will attempt to return the
33           version of that package if it is specified in the file.
34
35       filename()
36           Returns the absolute path to the file.
37
38       packages_inside()
39           Returns a list of packages.
40
41       pod_inside()
42           Returns a list of POD sections.
43
44       contains_pod()
45           Returns true if there is any POD in the file.
46
47       pod($section)
48           Returns the POD data in the given section.
49
50       find_module_by_name($module, \@dirs)
51           Returns the path to a module given the module or package name. A
52           list of directories can be passed in as an optional parameter,
53           otherwise @INC is searched.
54
55           Can be called as either an object or a class method.
56
57       find_module_dir_by_name($module, \@dirs)
58           Returns the entry in @dirs (or @INC by default) that contains the
59           module $module. A list of directories can be passed in as an
60           optional parameter, otherwise @INC is searched.
61
62           Can be called as either an object or a class method.
63
64       package_versions_from_directory($dir, \@files?)
65           Scans $dir for .pm files (unless @files is given, in which case
66           looks for those files in $dir - and reads each file for packages
67           and versions, returning a hashref of the form:
68
69             {
70               'Package::Name' => {
71                 version => '0.123',
72                 file => 'Package/Name.pm'
73               },
74               'OtherPackage::Name' => ...
75             }
76
77       log_info (internal)
78           Used internally to perform logging; imported from Log::Contextual
79           if Log::Contextual has already been loaded, otherwise simply calls
80           warn.
81

AUTHOR

83       Ken Williams <kwilliams@cpan.org>, Randy W. Sims
84       <RandyS@ThePierianSpring.org>
85
86       Released as Module::Metadata by Matt S Trout (mst)
87       <mst@shadowcat.co.uk> with assistance from David Golden (xdg)
88       <dagolden@cpan.org>
89
91       Copyright (c) 2001-2011 Ken Williams.  All rights reserved.
92
93       This library is free software; you can redistribute it and/or modify it
94       under the same terms as Perl itself.
95
96
97
98perl v5.12.3                      2011-02-03               Module::Metadata(3)
Impressum