Choosing a License

Chapter 4 - CPAN Module Distributions
by?Sam Tregar?
Apress ? 2002
has companion web siteCompanion Web Site

In the first part of the chapter, you saw that the README file generated by h2xs contains a section to indicate the copyright and license information for your module. You should include license information with your module so that people know what they're allowed to do with your module. It's a good idea to include your copyright and license information in your module's POD documentation as well as in your README.

The success of the entire open-source and free-software movements, in which CPAN exists, is founded on licenses. Free-software and open-source licenses grant the user the right to view, modify, and redistribute the code for a given piece of software. Contrast this to the licenses that come with proprietary products where you are neither allowed to see the source code nor redistribute it if you did. Clearly, CPAN can only function within the context of open-source and free software.

Perl's License

Most CPAN modules are licensed under the same license as Perl. In their documentation they contain something like the following:

 Copyright (c) YEAR, NAME. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 

Perl's license is a bit unusual—it is a hybrid license. A hybrid license is one that allows users to choose between more than one license. In this case, the user is offered the choice between the GPL and the Artistic License. The GPL is the GNU General Public License created by the Free Software Foundation.

Perl's license is included in the Perl distribution in a file called README. You can view a copy of the GPL on the Web at http://www.gnu.org/copyleft/gpl.html. The Artistic License was created for Perl and can be found on the Web at http://www.perl.com/language/misc/Artistic.html.

Using Other Licenses

Using Perl's license for your module is generally a good idea. Since your users are already using Perl, you know that the license will be acceptable to them. When most modules use the same license, it makes life easier for users since they don't have to worry about whether using a module will put them in danger of legal troubles. In addition, module authors benefit since they can share code without needing to worry about incompatible[27] licenses. However, CPAN doesn't place any restrictions on the license you apply to your module. The only practical requirement is that the module must be freely distributable; otherwise CPAN itself would be violating your license by distributing your module among the CPAN mirrors!

If you choose to use a license other than Perl's, you should make sure that users will know about it. Consider putting a large warning at the top of your module documentation and README to get their attention. Better yet, consider just using Perl's license. It's the best thing for the Perl community.[28]

I Am Not a Lawyer

Licenses are legal documents, and you should consult a lawyer if you need help deciding which one to use.

[27]Licenses are incompatible when the terms of one license specify restrictions that are not allowed by the other.

[28]Even the Free Software Foundation, usually a proponent of pure GPL usage, agrees: "We recommend you use [the Perl] license for any Perl 4 or Perl 5 package you write, to promote coherence and uniformity in Perl programming." See http://www.gnu.org/philosophy/license-list.html for this quote and more.



Writing Perl Modules for CPAN
Writing Perl Modules for CPAN
ISBN: 159059018X
EAN: 2147483647
Year: 2002
Pages: 110
Authors: Sam Tregar

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net