in reply to How to find and remove duplicate elements from an array?
use strict; my @arr = ("A", "B", "ABB", "C", "ABB", "B","C" ); my %hash = (); my @list = (); foreach my $word (@ary) { push( @list,$word ) unless $hash{$item}++; } print join("\n", @list), "\n";
Originally posted as a Categorized Answer.
|
|---|