Debian...arated(3pm)

πŸ“¦
version 0.2 Β· 4 versions
, in ubuntu noble, ubuntu resolute

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 (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