in reply to removing a sublist

See perlfaq4 (arrays section) and Perl Cookbook, recipe 4.8 "Finding elements in one array but not another".

I would do it like this:

my @winners = ( "ruth", "sheila" ); my @correct = ( "ruth", "martin", "dee", "zack" ); # Build lookup table of winners my %in_winners = map { $_ => 1 } @winners; # Find items that are in @correct but not in @winners my @correct_only = grep { not $in_winners{$_} } @correct;