Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $set = (1, 2, 3).SetHash;
- $set.elems == 3 or die "Wrong element count";
- # Add a new element.
- $set{4} = True;
- $set.elems == 4 or die "Wrong element count";
- # Add a duplicated element, no effect.
- $set{3} = True;
- $set.elems == 4 or die "Wrong element count";
- # Remove an element.
- $set{1} = False;
- $set.elems == 3 or die "Wrong element count";
- # Remove a non-existing element, no effect.
- $set{1} = False;
- $set.elems == 3 or die "Wrong element count";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement