1Software::LicenseUtils(U3s)er Contributed Perl DocumentatSioofntware::LicenseUtils(3)
2
3
4
6 Software::LicenseUtils - little useful bits of code for licensey things
7
9 version 0.104002
10
12 This module is part of CPAN toolchain, or is treated as such. As such,
13 it follows the agreement of the Perl Toolchain Gang to require no newer
14 version of perl than v5.8.1. This version may change by agreement of
15 the Toolchain Gang, but for now is governed by the Lancaster Consensus
16 <https://github.com/Perl-Toolchain-Gang/toolchain-
17 site/blob/master/lancaster-consensus.md> of 2013.
18
20 guess_license_from_pod
21 my @guesses = Software::LicenseUtils->guess_license_from_pod($pm_text);
22
23 Given text containing POD, like a .pm file, this method will attempt to
24 guess at the license under which the code is available. This method
25 will return either a list of Software::License classes names (as
26 strings) or false.
27
28 This method looks for a POD heading like 'license', 'copyright', or
29 'legal'.
30
31 Calling this method in scalar context is a fatal error.
32
33 guess_license_from_meta
34 my @guesses = Software::LicenseUtils->guess_license_from_meta($meta_str);
35
36 Given the content of the META.(yml|json) file found in a CPAN
37 distribution, this method makes a guess as to which licenses may apply
38 to the distribution. It will return a list of zero or more
39 Software::License instances or classes.
40
41 guess_license_from_meta_key
42 my @guesses = Software::LicenseUtils->guess_license_from_meta_key($key, $v);
43
44 This method returns zero or more Software::License classes known to use
45 $key as their META key. If $v is supplied, it specifies whether to
46 treat $key as a v1 or v2 meta entry. Any value other than 1 or 2 will
47 raise an exception.
48
49 new_from_short_name
50 my $license_object = Software::LicenseUtils->new_from_short_name( {
51 short_name => 'GPL-1',
52 holder => 'X. Ample'
53 }) ;
54
55 Create a new Software::License object from the license specified with
56 "short_name". Known short license names are "GPL-*", "LGPL-*" ,
57 "Artistic" and "Artistic-*"
58
59 new_from_spdx_expression
60 my $license_object = Software::LicenseUtils->new_from_spdx_expression( {
61 spdx_expression => 'MPL-2.0',
62 holder => 'X. Ample'
63 }) ;
64
65 Create a new Software::License object from the license specified with
66 "spdx_expression". Some licenses doesn't have an spdx identifier (for
67 example Software::License::Perl_5), so you can pass spdx identifier but
68 also expressions. Known spdx license identifiers are "BSD", "MPL-1.0".
69
71 Ricardo Signes <rjbs@semiotic.systems>
72
74 This software is copyright (c) 2022 by Ricardo Signes.
75
76 This is free software; you can redistribute it and/or modify it under
77 the same terms as the Perl 5 programming language system itself.
78
79
80
81perl v5.36.0 2023-01-20 Software::LicenseUtils(3)