my @list = qw(fish bread eggs eggs fish butter); my %check; $check{$_}++ foreach @list; my @unique = grep { $check{$_} == 1 } keys %check;