Set::Object::Weak(3pm)

Set::Object::Weak3pm

Sets without the referant reference increment

Usage

 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

Overview

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.

weak_set( ... )

This optionally exported function is a shortcut for saying "Set::Object::Weak->new(...)".

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);

Set::Object 1.19 had a bug in this method that meant that it would not add the passed members into it.

Credits

Perl magic by Sam Vilain, <[email protected]>

Idea from nothingmuch.

Releases

9 releases since Debian 5.0 (Lenny); the text changed 8 times.

  1. 5.0
  2. 6.0
  3. 7
  4. 8
  5. 9
  6. 10
  7. 11
  8. 12
  9. 13

From libset-object-perl 1.42-1+b5 in Debian 13 (Trixie). Parsed by carta from the page's man source.