Debian...parated(3pm)

πŸ’– Debian::Control::Stanza::CommaSeparated(3pm) πŸ’–

okay bestie, welcome to the perl user-contributed documentation for Debian::Control::Stanza::CommaSeparated β€” yes that name is a whole mouthful, we know, but she's worth it 🫢


🌸 NAME 🌸

Debian::Control::Stanza::CommaSeparated β€” the comma separated debian/control field abstraction, and yes she ate πŸ’…


✨ SYNOPSIS ✨

my $f = Debian::Control::Stanza::CommaSeparated->new(
    'Joe M <joem@there.not>');
$f->add('"Smith, Agent" <asmith@hasyou.not>, Joe M <joem@there.not>');
print $f->as_string;
    # 'Joe M <joem@there.not>, "Smith, Agent" <asmith@hasyou.not>'
print "$f";     # the same
$f->sort;

look at her go, no cap πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically Debian::Control::Stanza::CommaSeparated handles the whole comma-separated-list-of-values situation for you β€” the kind of thing that lives in debian/control file fields like Uploaders. it's giving "I have a list and I want it parsed, deduped and tidy," and honestly? iconic.

lowkey important tea tho: the various dependency fields in debian/control also use comma-separated values, BUT the Debian::Dependencies class is the more suitable one for those πŸ‘€ because it can do extra stuff like finding overlapping dependency declarations. so don't come for this class for dependency drama, she's not that girl for that job πŸ™ˆ

πŸŽ€ CONSTRUCTOR πŸŽ€

  • new (initial values) β€” the initial values list gets parsed, and it's totally allowed to contain strings that are actually comma-separated lists already. those get split up all nicely using Text::ParseWords' quotewords routine ✨ so you can just hand her the messy thing and she'll sort it out.

πŸ’… METHODS πŸ’…

  • as_string β€” returns the text representation of the list. it's literally just a simple join of the elements by ", ". and the exact same function is used for overloading the stringification operation, so "$f" hits the same code path, periodt.
  • add @items β€” adds the given items to the list 🫢 items that are already present are not added, so the list stays unique. no duplicates, no chaos, we love a clean list.
  • sort β€” a handy method for sorting the list ⭐ she does exactly what it says on the tin, and it's handy fr fr.

🌈 SEE ALSO 🌈

ngl there's no SEE ALSO section in this one bestie, but the vibes mention Debian::Dependencies up in DESCRIPTION if that's your moment πŸ‘‘


that's the whole page, no notes πŸ’œ β€” brought to you by perl v5.40.1, dated 2026-05-08, straight out of the Debian...parated(3pm) era of Documentation. mwah πŸ˜­πŸ’–

πŸ“¦ where this page comes from