in reply to How to find and remove duplicate elements from an array?
Yes this is the most asked questions in Perlmonks.
use strict; my @arr = ("A", "B", "ABB", "C", "ABB", "B","C" ); my %hash = (); my @list = (); foreach my $word (@arr) { push( @list,$word ) unless $hash{$word}++; } print join("\n", @list), "\n";
And this can help you out. Even I too was not able to pull out the distinct one from the array. So wat I did was went for "Search" or "Super Search"
So all of you it is always better to serach for the problem you are facing becos some one or the other has faced these kind of similar problems and have been solved by our respected monks. So please do search before to make any postings.
Thanks
Sushil
Originally posted as a Categorized Answer.
In Section
Seekers of Perl Wisdom