use strict; my %h = (); $h{$_}=1 for (0 .. 100); while(1) { print "choose a number: " . join(",",sort { $a <=> $b } keys %h,"q") . "\n"; my $in = ; chomp $in; if ($in eq "q") { last; } delete $h{$in}; } print "remaining: " . join(",", sort { $a <=> $b } keys %h) . "\n";