.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.47)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Required to disable full justification in groff 1.23.0.
.if n .ds AD l
.\" ========================================================================
.\"
.IX Title "Software::LicenseUtils 3"
.TH Software::LicenseUtils 3 2025-07-25 "perl v5.42.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
Software::LicenseUtils \- little useful bits of code for licensey things
.SH VERSION
.IX Header "VERSION"
version 0.104007
.SH "PERL VERSION"
.IX Header "PERL VERSION"
This module is part of CPAN toolchain, or is treated as such.  As such, it
follows the agreement of the Perl Toolchain Gang to require no newer version
of perl than one released in the last ten years.  This version may change by
agreement of the Toolchain Gang, but for now is governed by the Lancaster
Consensus <https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lancaster-consensus.md>
of 2013 and the Lyon Amendment of 2023 (described at the linked\-to document).
.PP
Although it may work on older versions of perl, no guarantee is made that the
minimum required version will not be increased.  The version may be increased
for any reason, and there is no promise that patches will be accepted to
lower the minimum required perl.
.SH METHODS
.IX Header "METHODS"
.SS guess_license_from_pod
.IX Subsection "guess_license_from_pod"
.Vb 1
\&  my @guesses = Software::LicenseUtils\->guess_license_from_pod($pm_text);
.Ve
.PP
Given text containing POD, like a .pm file, this method will attempt to guess
at the license under which the code is available.  This method will return
either a list of Software::License classes names (as strings) or false.
.PP
This method looks for a POD heading like \*(Aqlicense\*(Aq, \*(Aqcopyright\*(Aq, or \*(Aqlegal\*(Aq.
.PP
Calling this method in scalar context is a fatal error.
.SS guess_license_from_meta
.IX Subsection "guess_license_from_meta"
.Vb 1
\&  my @guesses = Software::LicenseUtils\->guess_license_from_meta($meta_str);
.Ve
.PP
Given the content of the META.(yml|json) file found in a CPAN distribution, this
method makes a guess as to which licenses may apply to the distribution.  It
will return a list of zero or more Software::License instances or classes.
.SS guess_license_from_meta_key
.IX Subsection "guess_license_from_meta_key"
.Vb 1
\&  my @guesses = Software::LicenseUtils\->guess_license_from_meta_key($key, $v);
.Ve
.PP
This method returns zero or more Software::License classes known to use \f(CW$key\fR
as their META key.  If \f(CW$v\fR is supplied, it specifies whether to treat \f(CW$key\fR
as a v1 or v2 meta entry.  Any value other than 1 or 2 will raise an exception.
.SS new_from_short_name
.IX Subsection "new_from_short_name"
.Vb 4
\&  my $license_object = Software::LicenseUtils\->new_from_short_name( {
\&     short_name => \*(AqGPL\-1\*(Aq,
\&     holder => \*(AqX. Ample\*(Aq
\&  }) ;
.Ve
.PP
Create a new Software::License object from the license specified
with \f(CW\*(C`short_name\*(C'\fR. Known short license names are \f(CW\*(C`GPL\-*\*(C'\fR, \f(CW\*(C`LGPL\-*\*(C'\fR ,
\&\f(CW\*(C`Artistic\*(C'\fR and \f(CW\*(C`Artistic\-*\*(C'\fR
.SS new_from_spdx_expression
.IX Subsection "new_from_spdx_expression"
.Vb 4
\&  my $license_object = Software::LicenseUtils\->new_from_spdx_expression( {
\&     spdx_expression => \*(AqMPL\-2.0\*(Aq,
\&     holder => \*(AqX. Ample\*(Aq
\&  }) ;
.Ve
.PP
Create a new Software::License object from the license specified
with \f(CW\*(C`spdx_expression\*(C'\fR. Some licenses doesn\*(Aqt have an spdx
identifier (for example Software::License::Perl_5), so you can pass
spdx identifier but also expressions.
Known spdx license identifiers are \f(CW\*(C`BSD\*(C'\fR, \f(CW\*(C`MPL\-1.0\*(C'\fR.
.SH AUTHOR
.IX Header "AUTHOR"
Ricardo Signes <cpan@semiotic.systems>
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
This software is copyright (c) 2025 by Ricardo Signes.
.PP
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
