This page provides some guidelines for including copyright and license notices in CPAN modules. The intention is that these guidelines can be used to create a code-kwalitee tool to check CPAN modules for license and copyright notics. The guidelines are marked as “required” (really necessary), “suggested” (strongly recommended), and “if you want to” (speaks for itself). Important Note: If code is licensed under a license other than an Artistic License or “the same terms as Perl”, that license may require that you to include additional material and notices.
The README file is the primary place for copyright and license notices. This is required for every CPAN distribution.
The first line of the README should be a copyright notice in the form of:
- Then, under a "LICENSE INFORMATION" heading, add the required license notice:
This [library|program|code|module] is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES. Always identify a specific version of Perl, rather than the general statement “same terms as Perl itself”. If you’re using a license other than a license used for a specific Perl package, always identify the version number of the license: This [library|program|code|module] is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license in the file LICENSE.
- It's suggested that you include a warranty disclaimer in the license notice. The warranty disclaimer should be consistent with the warranty disclaimer in the license that applies to your package. For instance, if the Artistic License 2.0 applies:
This program is distributed in the hope that it will be useful, but it is provided “as is” and without any express or implied warranties. For details, see the full text of the license in the file LICENSE.
- Also in the README file, right under the license notice, it is suggested to include a list of files that have different copyright owners or that are subject to different licenses. As noted earlier, licenses other than one of the Artistic Licenses may require that you include additional notices and material.
Files with different licenses or copyright holders:
- Also required is license metadata in the META.yml file that identifies the relevant license, for example:
license: perl or: license: artistic2
- It's suggested that you include the full text of the license in a file called LICENSE, or for dual licensing (e.g. Artistic/GPL as in "the same terms as Perl"), include both licenses in a directory called LICENSES. If you don't include the full text of the license in the module, then provide a URL instead (either full-text or URL is required), changing the sentence in the license notice to:
For more details, see the full text of the licenses at artistic-license-10.html, and http://www.gnu.org/licenses/gpl-2.0.html. URLs can change, so it’s best to use a reliable URL like The Perl Foundation site, the Free Software Foundation site, or the Open Source Initiative site (opensource.org).
- It's suggested that you include a copyright notice at the top of every file in your CPAN distribution.
Copyright (C)
- It's suggested that you include a license and copyright notice in the POD documentation of the main module in your CPAN distribution, so it can be easily found by people reading the documentation on a site like search.cpan.org. This copyright and license notice should appear under a heading "COPYRIGHT AND LICENSE", and the license notice should be an exact copy of the license notice text you included in the README file. You should not include copyright information under the AUTHOR heading. For example:
AUTHOR
- If you want to, you may include the "COPYRIGHT AND LICENSE" POD section in every module file.