Debian...arated(3pm)
π Debian::Copyright::Stanza::OrSeparated π
okay bestie, so this is a page from the User Contributed Perl Documentation section β the manual name is Debian...arated(3pm) (yes, it's truncated like that, the full module name lives in the page title) β and it's all about the Debian::Copyright::Stanza::OrSeparated module, aka the "'or' separated field abstraction". It's short, it's sweet, it's giving "tiny helper module with main character energy". β¨
πΈ VERSION πΈ
This doc describes Debian::Copyright::Stanza::OrSeparated version 0.2.
π¦ SYNOPSIS π¦
okay so here's the vibe in code form, no cap:
my $f = Debian::Copyright::Stanza::OrSeparated->new('Artistic');
$f->add('GPL-1+ or BSD');
print $f->as_string;
# 'Artistic or GPL-1+ or BSD'
print "$f"; # the same
$f->sort;
π DESCRIPTION π
Debian::Copyright::Stanza::OrSeparated is the lowkey MVP that handles the abstraction for License fields inside Files blocks β and those fields? They're lists, separated by 'or'. That's the whole plot twist.
it ALSO supports a body field, which represents the optional extended description of a License field. extra detail, extra slay. π
π CONSTRUCTOR π
β¨ new (initial values)
The initial values list gets parsed, and β plot twist β it might contain strings that are actually 'or'-separated lists already. Those get split appropriately using Text::ParseWords' "quotewords" routine. It handles the splitting for you so you don't have to. periodt.
π METHODS π
π as_string
Returns the text representation of the list. It's a simple join of the elements by " or ". Same function is used to overload the stringification operation, so print "$f" hits the exact same thing. iykyk.
πΈ equals
The natural implementation of the equality function. like, obviously. π«Ά
π add @items
Adds the given items to the list. Items that are already present are not added β the list stays unique. no duplicates allowed in this house, we're keeping it clean. β¨
π¦ sort
A handy method for sorting the list. so handy. so method. go off. π
π COPYRIGHT & LICENSE π
Copyright (C) 2011-12 Nicholas Bamber <nicholas@periapt.co.uk>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
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. π (yes bestie, all caps, they really meant it)
and that's the whole page, bestie β written for perl v5.36.0, dated 2022-10-14, from the Debian...arated(3pm) corner of the User Contributed Perl Documentation. stan a tiny module that does exactly one thing and does it flawlessly. πβ¨
π¦ where this page comes from
- ubuntu noble: libdebian-copyright-perl 0.2-6 Β· GPL-2.0-or-later
- ubuntu resolute: libdebian-copyright-perl 0.2-6 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms