Module::License::Report - Determine the license of a module
Copyright 2005 Clotho Advanced Media, Inc., <email@example.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
use Module::License::Report; my $reporter = Module::License::Report->new(); my $license = $reporter->license('Module::License::Report'); print $license; # 'perl' print $license->source_file(); # 'META.yml' print $license->confidence(); # '100' print $license->package_version(); # '0.01' my %lic = $reporter->license_chain('Module::License::Report'); # ( Module-License-Report => 'perl', CPANPLUS => 'perl', ... )
People who redistribute Perl code must be careful that all of the included libraries are compatible with the final distribution license. A large fraction of CPAN packages are licensed as
Artistic/GPL, like Perl itself, but not all. If you are going to package your work in, say, a PAR archive with all of its dependencies it's critical that you inspect the licenses of those dependencies. This module can help.
This module utilizes CPANPLUS to do much of the hard work of locating the requested CPAN distribution, downloading and extracting it. If you've never used CPANPLUS before, there will be a one-time setup step for that module.
Creates a new instance. Optional parameters can be passed in a hash reference. The recognized options are:
Retrieves a license object for the specified module, or undef if no license could be found. The license object stringifies to the name of the license. See also Module::License::Report::Object.
$module_name argument is usually a package name like
Foo::Bar. It can also be the distribution name, like
Foo-Bar. This is useful for distributions like Text-PDF where there is no actual module named Text::PDF, but which has Text::PDF::File instead.
This method uses CPANPLUS to download and inspect the source distribution of the module. If you've never used CPANPLUS before, there will be a one-time setup phase to configure that module.
Returns a hash of
dist_name => license pairs where the
dist_name keys are the distributions of specified module and all of its dependencies, as reported by Module::Depends. The values are Module::License::Report::Object instances. Perl core modules are omitted, as those are all known to be licensed like Perl itself.
No specific bugs known. See rt.cpan.org for more up-to-date information.
The heuristics for guessing the license from files other than META.yml are sketchy. These could always use improvement.
I am not aware of any other module that performs the function of determining license, except in limited ways (like CPANPLUS determines DSLIP and Module::Build uses
This module has over 80% test code coverage in every category and over 90% overall, as reported by Devel::Cover via
perl Build testcover.
This module passes Perl Best Practices guidelines, as enforced by Perl::Critic v0.12_03.
Clotho Advanced Media Inc., firstname.lastname@example.org
Primary developer: Chris Dolan
Thanks to module-authors @ perl.org for naming advice.