Set::S...:Valued(3pm)
π Set::S...:Valued π
ok so bestie, this is the manpage for Set::Scalar::Valued (yes the header abbreviates it, it's giving mysterious but it's literally just Set::Scalar::Valued, part of the User Contributed Perl Documentation situation) β it's a Perl module and it's lowkey iconic. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
Set::Scalar::Valued β valued sets π
πΈ SYNOPSIS πΈ
use Set::Scalar::Valued;
$s = Set::Scalar::Valued->new;
$s->insert(a => 12, 'b c' => $d);
$s->delete('b c' => $d);
$t = Set::Scalar->new(x => $y, y => $z);
see how every member gets to bring a lil plus-one value along?? that's the whole vibe π
π¦ DESCRIPTION π¦
okay so valued sets are an extension of the traditional set concept, no cap. in a regular set a member just... exists. in a valued set, the member also has a distinct value attached to it. think of it as a traditional set and a Perl hash had a baby and the baby ate π
the methods are the same as for the traditional Set::Scalar, with one lil twist: when you're creating (new()) or modifying (insert(), delete(), invert()), you have to supply twice the number of arguments β the member-value pairs, instead of just the members. periodt.
β οΈ okay important, bestie, read this twice: in the current implementation of delete(), the value half is unused β the deletion happens by the member. so the value you pass in is just... there, vibing, doing nothing. in a future implementation this behavior may change so that the value matters too. so don't build your whole personality on the value being ignored, iykyk π
there are a couple of additional methods, and they're honestly the moment:
%ve = $s->valued_members;
which returns the member-value pairs, and
@v = $s->values;
which returns just the values β and listen, they come back in the same order as the members() method would return the members, so the alignment stays cute and correct β¨
and
$v = $s->value($member);
which returns the value of the member. yes, one member, one value, very demure, very mindful πΈ
last thing, the display format of a valued set: it's the member-value pairs separated by " => ", the pairs separated by ", ", and the whole thing enclosed in curly brackets {}. so it's giving hash-but-make-it-a-set and honestly? obsessed π
π AUTHOR π
Jarkko Hietaniemi <jhi@iki.fi> β legend behavior fr fr π«Ά
and that's the whole page, bestie!! this was Set::S...:Valued(3pm) from perl v5.34.0, dated 2022-06-17, brought to you by User Contributed Perl Documentation. go forth and value your members πβ¨ππ¦π
π¦ where this page comes from
- debian bookworm: libset-scalar-perl 1.29-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libset-scalar-perl 1.29-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libset-scalar-perl 1.29-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libset-scalar-perl 1.29-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libset-scalar-perl 1.29-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms