package Set::NoReplace;
sub new { bless {}, shift; }
sub add { $_[0]{$_[1]} = 1 unless exists $_[0]{$_[1]}; }
sub del { $_[0]{$_[1]} = 0 if exists $_[0]{$_[1]}; }
use overload '""' => sub { return join ', ', sort grep { $_[0]{$_} } keys %{$_[0]}; };
my $x = Set::NoReplace->new;
$x->add( 3 );
$x->add( 5 );
$x->add( 1 );
print $x, "\n";
$x->del( 3 );
print $x, "\n";
$x->add( 3 );
$x->add( 7 );
print $x, "\n";