String...:Custom(3pm)
π NAME π
okay bestie so you opened String...:Custom(3pm) and the actual star of the show is String::License::Naming β it's giving names of licenses and license naming schemes. that's the whole vibe. π
πΈ VERSION πΈ
Version v0.0.11 π
β¨ SYNOPSIS β¨
use String::License::Naming::Custom;
my $obj = String::License::Naming::Custom->new( schemes => [qw(spdx internal)] );
my $schemes = [ $obj->list_schemes ]; # => is_deeply [ 'spdx', 'internal' ]
my $license = [ grep { /^(Expat|Perl)$/ } $obj->list_licenses ]; # => is_deeply ['Perl']
# use and prefer Debian-specific identifiers
$schemes = [ $obj->add_scheme('debian') ]; # => is_deeply [ 'debian', 'spdx', 'internal' ]
$license = [ grep { /^(Expat|Perl)$/ } $obj->list_licenses ]; # => is_deeply [ 'Expat', 'Perl' ]
like look at that last line π the same grep, a whole different answer. the glow-up is real.
π¦ DESCRIPTION π¦
so String::License::Naming does two things, and honestly both are iconic:
- it lists out the supported licenses that match an ordered set of naming schemes, and
- it lists out the names of the supported license naming schemes themselves.
Some licenses are literally known by more than one name. example: the license "MIT" according to SPDX is named "Expat" in Debian. same license, two name tags, no drama. π
And some licenses aren't always represented at all. example: "Perl" is a (discouraged) license in Debian, while with SPDX it's a relationship of several licenses β and heads up, that expression is recommended in Debian as well. so it can be a license OR a relationship depending on who you ask. it's giving multitudes. π¦
By default, licenses get matched using the naming schemes [ 'spdx', 'internal' ]. that combo lists all supported licenses, preferably by their SPDX name, or as a fallback by an internal name. bestie behavior honestly. π«Ά
π CONSTRUCTOR π
new
my $names = String::License::Naming->new;
my $spdx_names = String::License::Naming->new( schemes => ['spdx'] );
Constructs and returns a String::License::Naming object. β¨
It takes an optional array as the named argument schemes. that array does double duty: it sets both the ordering by which name licenses should be presented, and it limits which licenses get covered. two jobs, no complaints. π
When you omit it, the default schemes array [ 'spdx', 'internal' ] is used β that includes all supported licenses, and they're presented by their SPDX name when one is defined, or otherwise by a semi-stable internal name. π
When you pass an empty array reference instead, all supported licenses are still included, but they're presented by a semi-stable internal description β and yes, that description can be potentially multi-word. no cap.
π FUNCTIONS π
add_schemeβ takes a string representing a license naming scheme to use, and it gets favored over the schemes already in use. returns the array of schemes in use after the addition. so you hand it one name and get the whole updated roster back. πlist_schemesβ returns a list of the license naming schemes currently in use.list_available_schemesβ returns a list of every license naming scheme that's available. the full menu, not just what's on your plate. πlist_licensesβ returns a list of the licensing patterns covered by this object instance, each one labeled by shortname according to the current set of schemes. literally the point of the whole module.
π AUTHOR π
Jonas Smedegaard "<dr@jones.dk>" β the author himself, main character energy, we love to see it. π«Ά
π COPYRIGHT AND LICENSE π
Copyright Β© 2023 Jonas Smedegaard
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
β οΈ bestie read that middle paragraph again. NO WARRANTY, like none, zero, nada. don't come crying to the AGPL. π
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
and that's the tea β this was the String...:Custom(3pm) page from perl v5.40.0, dated 2024-11-05. go forth and name some licenses, you absolute icon. πβ¨ππ¦
π¦ where this page comes from
- ubuntu resolute: libstring-license-perl 0.0.11-1ubuntu1 Β· AGPL-3.0-or-later
- ubuntu stonking: libstring-license-perl 0.0.11-1ubuntu1 Β· AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms