PNI::Set - is a set of elements
my $set = PNI::Set->new; my $elem1 = PNI::Elem->new; $set->add($elem1); my $elem2 = PNI::Elem->new; $set->add($elem2); $set->list; # ($elem1,$elem2) my $elem1_id = $elem1->id; $set->elem->{$elem1_id}; # $elem1
my $elem_hashref = $set->elem;
Hash of elements contained in this PNI::Set.
my $elem_foo = $set->elem->{'foo_id'};
Minimum number of elements: default is 0.
Maximum number of elements: default is 0, which means infinity otherwise it would be the empty set.
$set->add($elem);
Add a PNI::Elem to this PNI::Set.
my $num_elems = $set->cardinality;
Returns the number of elements in the set.
$set->del($elem);
Remove a PNI::Elem from this PNI::Set.
my @ids = $set->ids;
Returns a list containing every id of the elements cointained in the set.
id
my @elems = $set->list;
Returnx a list containing every element of the set.
element
To install PNI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PNI
CPAN shell
perl -MCPAN -e shell install PNI
For more information on module installation, please visit the detailed CPAN module installation guide.