Set::Object::Weak(3)

okay so bestie πŸ’– you just opened Set::Object::Weak(3) β€” that's the title, and it's chilling in the User Contributed Perl Documentation section. It's giving "sets, but make it weak" and I'm obsessed ✨

🌸 NAME 🌸

Set::Object::Weak β€” Sets without the referant reference increment 🫢

πŸ¦‹ SYNOPSIS πŸ¦‹

use Set::Object::Weak qw(weak_set);

my $set = Set::Object::Weak->new( 0, "", {}, [], $object );
# or
my $set = weak_set( 0, "", {}, [], $object );

print $set->size;  # 2 - the scalars aren't objects

πŸ’– DESCRIPTION πŸ’–

Sets, but weak. See weaken in Set::Object πŸ‘€

Note that the set in Set::Object::Weak returns weak sets. This is intentional, so that you can make all the sets in scope weak just by changing use Set::Object to use Set::Object::Weak ✨

πŸŽ€ CONSTRUCTORS πŸŽ€

new

This class method is exactly the same as Set::Object->new, except that it returns a weak set. slay πŸ’…

weak_set( ... )

This optionally exported function is a shortcut for saying Set::Object::Weak->new(...). iconic πŸ¦‹

set( ... )

This method is exported so that if you see:

use Set::Object qw(set);

You can turn it into using weak sets lexically with:

use Set::Object::Weak qw(set);

ngl, Set::Object 1.19 had a bug in this method that meant that it would not add the passed members into it πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

  • Set::Object β€” go read this one too, bestie, it's the whole reference vibe πŸ’–

πŸ‘‘ CREDITS πŸ‘‘

Perl magic by Sam Vilain, <samv@cpan.org> ✨

Idea from nothingmuch 🫢


that's the whole page, bestie 🫢 β€” brought to you by perl v5.40.2, dated 2026-05-05, and signed Set::Object::Weak(3) 🌈

πŸ“¦ where this page comes from