Vulnerabilities | |||||
---|---|---|---|---|---|
Version | Suggest | Low | Medium | High | Critical |
1.000038 | 0 | 0 | 0 | 0 | 0 |
1.000037 | 0 | 0 | 0 | 0 | 0 |
1.000036 | 0 | 0 | 0 | 0 | 0 |
1.000035 | 0 | 0 | 0 | 0 | 0 |
1.000034-TRIAL | 0 | 0 | 0 | 0 | 0 |
1.000033 | 0 | 0 | 0 | 0 | 0 |
1.000032-TRIAL | 0 | 0 | 0 | 0 | 0 |
1.000031-TRIAL | 0 | 0 | 0 | 0 | 0 |
1.000030-TRIAL | 0 | 0 | 0 | 0 | 0 |
1.000029-TRIAL | 0 | 0 | 0 | 0 | 0 |
1.000028-TRIAL | 0 | 0 | 0 | 0 | 0 |
1.000027 | 0 | 0 | 0 | 0 | 0 |
1.000026 | 0 | 0 | 0 | 0 | 0 |
1.000025 | 0 | 0 | 0 | 0 | 0 |
1.000024 | 0 | 0 | 0 | 0 | 0 |
1.000023 | 0 | 0 | 0 | 0 | 0 |
1.000022 | 0 | 0 | 0 | 0 | 0 |
1.000021 | 0 | 0 | 0 | 0 | 0 |
1.000020 | 0 | 0 | 0 | 0 | 0 |
1.000019 | 0 | 0 | 0 | 0 | 0 |
1.000018 | 0 | 0 | 0 | 0 | 0 |
1.000017 | 0 | 0 | 0 | 0 | 0 |
1.000016 | 0 | 0 | 0 | 0 | 0 |
1.000013 | 0 | 0 | 0 | 0 | 1 |
1.000012 | 0 | 0 | 0 | 0 | 1 |
1.000038 - This version may not be safe as it has not been updated for a long time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform
Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.
Artistic-1.0 - Artistic License 1.0=pod
=encoding UTF-8
=head1 NAME
Module::Metadata - Gather package and POD information from perl module files
=head1 VERSION
version 1.000038
=head1 SYNOPSIS
use Module::Metadata;
my $info = Module::Metadata->new_from_file( $file ); my $version = $info->version;
my $provides = Module::Metadata->provides( dir => 'lib', version => 2 );
=head1 DESCRIPTION
This module provides a standard way to gather metadata about a .pm file through (mostly) static analysis and (some) code execution. When determining the version of a module, the C<$VERSION> assignment is Ced, as is traditional in the CPAN toolchain.
=head1 CLASS METHODS
=head2 C<< new_from_file($filename, collect_pod => 1, decode_pod => 1) >>
Constructs a CModule::Metadata object given the path to a file. Returns undef if the filename does not exist.
C<collect_pod> is a optional boolean argument that determines whether POD data is collected and stored for reference. POD data is not collected by default. POD headings are always collected.
If the file begins by an UTF-8, UTF-16BE or UTF-16LE byte-order mark, then it is skipped before processing, and the content of the file is also decoded appropriately starting from perl 5.8.
Alternatively, if C<decode_pod> is set, it will decode the collected pod sections according to the C<=encoding> declaration.
=head2 C<< new_from_handle($handle, $filename, collect_pod => 1, decode_pod => 1) >>
This works just like C<new_from_file>, except that a handle can be provided as the first argument.
Note that there is no validation to confirm that the handle is a handle or something that can act like one. Passing something that isn't a handle will cause a exception when trying to read from it. The C argument is mandatory or undef will be returned.
You are responsible for setting the decoding layers on C<$handle> if required.
=head2 C<< new_from_module($module, collect_pod => 1, inc => @dirs, decode_pod => 1) >>
Constructs a CModule::Metadata object given a module or package name. Returns undef if the module cannot be found.
In addition to accepting the C<collect_pod> and C<decode_pod> arguments as described above, this method accepts a C argument which is a reference to an array of directories to search for the module. If none are given, the default is @INC.
If the file that contains the module begins by an UTF-8, UTF-16BE or UTF-16LE byte-order mark, then it is skipped before processing, and the content of the file is also decoded appropriately starting from perl 5.8.
=head2 C<< find_module_by_name($module, @dirs) >>
Returns the path to a module given the module or package name. A list of directories can be passed in as an optional parameter, otherwise @INC is searched.
Can be called as either an object or a class method.
=head2 C<< find_module_dir_by_name($module, @dirs) >>
Returns the entry in C<@dirs> (or C<@INC> by default) that contains the module C<$module>. A list of directories can be passed in as an optional parameter, otherwise @INC is searched.
Can be called as either an object or a class method.
=head2 C<< provides( %options ) >>
This is a convenience wrapper around C<package_versions_from_directory> to generate a CPAN META C data structure. It takes key/value pairs. Valid option keys include:
=over
=item version B<(required)>
Specifies which version of the LCPAN::Meta::Spec should be used as the format of the C output. Currently only '1.4' and '2' are supported (and their format is identical). This may change in the future as the definition of C changes.
The C option is required. If it is omitted or if an unsupported version is given, then C will throw an error.
=item dir
Directory to search recursively for F<.pm> files. May not be specified with C.
=item files
Array reference of files to examine. May not be specified with C
.=item prefix
String to prepend to the C field of the resulting output. This defaults to F, which is the common case for most CPAN distributions with their F<.pm> files in F. This option ensures the META information has the correct relative path even when the C
or C arguments are absolute or have relative paths from a location other than the distribution root.=back
For example, given C
of 'lib' and C of 'lib', the return value is a hashref of the form:{ 'Package::Name' => { version => '0.123', file => 'lib/Package/Name.pm' }, 'OtherPackage::Name' => ... }
=head2 C<< package_versions_from_directory($dir, @files?) >>
Scans C<$dir> for .pm files (unless C<@files> is given, in which case looks for those files in C<$dir> - and reads each file for packages and versions, returning a hashref of the form:
{ 'Package::Name' => { version => '0.123', file => 'Package/Name.pm' }, 'OtherPackage::Name' => ... }
The C and C
packages are always omitted, as are any "private" packages that have leading underscores in the namespace (e.g. CFoo::_private)Note that the file path is relative to C<$dir> if that is specified. This B be used directly for CPAN META C. See the C method instead.
=head2 C<< log_info (internal) >>
Used internally to perform logging; imported from Log::Contextual if Log::Contextual has already been loaded, otherwise simply calls warn.
=head1 OBJECT METHODS
=head2 C<< name() >>
Returns the name of the package represented by this module. If there is more than one package, it makes a best guess based on the filename. If it's a script (i.e. not a *.pm) the package name is 'main'.
=head2 C<< version($package) >>
Returns the version as defined by the $VERSION variable for the package as returned by the C method if no arguments are given. If given the name of a package it will attempt to return the version of that package if it is specified in the file.
=head2 C<< filename() >>
Returns the absolute path to the file. Note that this file may not actually exist on disk yet, e.g. if the module was read from an in-memory filehandle.
=head2 C<< packages_inside() >>
Returns a list of packages. Note: this is a raw list of packages discovered (or assumed, in the case of C
). It is not filtered for C, C or private packages the way the C method does. Invalid package names are not returned, for example "Foo:Bar". Strange but valid package names are returned, for example "Foo::Bar::", and are left up to the caller on how to handle.=head2 C<< pod_inside() >>
Returns a list of POD sections.
=head2 C<< contains_pod() >>
Returns true if there is any POD in the file.
=head2 C<< pod($section) >>
Returns the POD data in the given section.
=head2 C<< is_indexable($package) >> or C<< is_indexable() >>
Available since version 1.000020.
Returns a boolean indicating whether the package (if provided) or any package (otherwise) is eligible for indexing by PAUSE, the Perl Authors Upload Server. Note This only checks for valid C declarations, and does not take any ownership information into account.
=head1 SUPPORT
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Module-Metadata> (or L<bug-Module-Metadata@rt.cpan.org|mailto:bug-Module-Metadata@rt.cpan.org>).
There is also a mailing list available for users of this distribution, at Lhttp://lists.perl.org/list/cpan-workers.html.
There is also an irc channel available for users of this distribution, at L<C<#toolchain> on C<irc.perl.org>|irc://irc.perl.org/#toolchain>.
=head1 AUTHOR
Original code from Module::Build::ModuleInfo by Ken Williams kwilliams@cpan.org, Randy W. Sims RandyS@ThePierianSpring.org
Released as Module::Metadata by Matt S Trout (mst) mst@shadowcat.co.uk with assistance from David Golden (xdg) dagolden@cpan.org.
=head1 CONTRIBUTORS
=for stopwords Karen Etheridge David Golden Vincent Pit Matt S Trout Chris Nehren Graham Knop Olivier Mengué Tomas Doran Christian Walde Craig A. Berry Tatsuhiko Miyagawa tokuhirom 'BinGOs' Williams Mitchell Steinbrunner Edward Zborowski Gareth Harper James Raspass Jerry D. Hedden Josh Jore Kent Fredric Leon Timmermans Peter Rabbitson Steve Hay
=over 4
=item *
Karen Etheridge ether@cpan.org
=item *
David Golden dagolden@cpan.org
=item *
Vincent Pit perl@profvince.com
=item *
Matt S Trout mst@shadowcat.co.uk
=item *
Chris Nehren apeiron@cpan.org
=item *
Graham Knop haarg@haarg.org
=item *
Olivier Mengué dolmen@cpan.org
=item *
Tomas Doran bobtfish@bobtfish.net
=item *
Christian Walde walde.christian@googlemail.com
=item *
Craig A. Berry cberry@cpan.org
=item *
Tatsuhiko Miyagawa miyagawa@bulknews.net
=item *
tokuhirom tokuhirom@gmail.com
=item *
Chris 'BinGOs' Williams chris@bingosnet.co.uk
=item *
David Mitchell davem@iabyn.com
=item *
David Steinbrunner dsteinbrunner@pobox.com
=item *
Edward Zborowski ed@rubensteintech.com
=item *
Gareth Harper gareth@broadbean.com
=item *
James Raspass jraspass@gmail.com
=item *
Jerry D. Hedden jdhedden@cpan.org
=item *
Josh Jore jjore@cpan.org
=item *
Kent Fredric kentnl@cpan.org
=item *
Leon Timmermans fawaka@gmail.com
=item *
Peter Rabbitson ribasushi@cpan.org
=item *
Steve Hay steve.m.hay@googlemail.com
=back
=head1 COPYRIGHT & LICENSE
Original code Copyright (c) 2001-2011 Ken Williams. Additional code Copyright (c) 2010-2011 Matt Trout and David Golden. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
=cut