package Abh::SimpleSet; sub new { my $self = {}; bless $self; return $self; } sub add { my ($self, $item) = @_; $self{$item} = undef; } sub remove { my ($self, $item) = @_; delete($self{$item}); } sub contains { my ($self, $item) = @_; return exists($self{$item}); } sub to_string { my $self = shift; return $class, "(" . join (", ", keys %self) . ")"; } sub union { my ($self, $otherSet) = @_; foreach $key (keys %otherSet) { $self{$key} = undef; } } # Must return true 1;