in reply to removing a sublist
Good solutions have been provided. The following includes randomly selecting a new winner:
map{$winners_hash{$_}++}@winners; @new_winners = grep{!$winners_hash{$_}}@correct; $the_winner = $new_winners[int(rand($#new_winners+1))];
Unless you're using an old version of perl, rand automatically calls srand.
Hope this helps!
|
|---|