Softwar...seUtils(3)

🌸 NAME 🌸

Software::LicenseUtils β€” like, little useful bits of code for licensey things πŸ’… (it's a Perl module btw, from the User Contributed Perl Documentation squad)


✨ VERSION ✨

version 0.104007 πŸŽ€


πŸͺ PERL VERSION πŸͺ

okay so this module is part of the CPAN toolchain, or is at least treated like it is, so it follows the agreement of the Perl Toolchain Gang to require no newer version of perl than one released in the last ten years. iconic behavior honestly 🫢

This version may change by agreement of the Toolchain Gang (they're the main characters of this decision), but for now it's 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 (which is described at that linked-to document).

And listen β€” although it may work on older versions of perl, there is no guarantee made that the minimum required version will not be increased 😭. The version may be increased for any reason, and there's no promise that patches will be accepted to lower the minimum required perl. periodt.


πŸ’– METHODS πŸ’–

πŸ” guess_license_from_pod

my @guesses = Software::LicenseUtils->guess_license_from_pod($pm_text);

Given text containing POD (like, say, a .pm file bestie), this method will attempt to guess at the license under which the code is available πŸ‘‘. It returns either a list of Software::License class names (as strings) or false.

This method looks for a POD heading like 'license', 'copyright', or 'legal'.

⚠️ Calling this method in scalar context is a fatal error. do not do it. I'm so serious πŸ’€

πŸ”Ž guess_license_from_meta

my @guesses = Software::LicenseUtils->guess_license_from_meta($meta_str);

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. slay ✨


πŸ—οΈ guess_license_from_meta_key

my @guesses = Software::LicenseUtils->guess_license_from_meta_key($key, $v);

This method returns zero or more Software::License classes known to use $key as their META key πŸ”‘

If $v is supplied, it specifies whether to treat $key as a v1 or v2 meta entry. Any value other than 1 or 2 will raise an exception 🚨 so like, don't test it.


🏷️ new_from_short_name

my $license_object = Software::LicenseUtils->new_from_short_name( {
   short_name => 'GPL-1',
   holder => 'X. Ample'
}) ;

Create a new Software::License object from the license specified with "short_name" πŸŽ€ Known short license names are "GPL-*", "LGPL-*", "Artistic" and "Artistic-*".


πŸ¦‹ new_from_spdx_expression

my $license_object = Software::LicenseUtils->new_from_spdx_expression( {
   spdx_expression => 'MPL-2.0',
   holder => 'X. Ample'
}) ;

Create a new Software::License object from the license specified with "spdx_expression". So here's the tea: some licenses doesn't have an spdx identifier (for example Software::License::Perl_5), so you can pass an spdx identifier but also expressions πŸ’… Known spdx license identifiers are "BSD", "MPL-1.0".


πŸ‘‘ AUTHOR πŸ‘‘

Ricardo Signes <cpan@semiotic.systems> β€” king behavior fr fr 🫢


This software is copyright (c) 2025 by Ricardo Signes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. no cap πŸ’œ


okay that's the whole page bestie, mwah πŸ’‹βœ¨

signing off with the deets: perl v5.42.0, dated 2025-05-05, and that's Software::LicenseUtils(3) out πŸ’–

πŸ“¦ where this page comes from