in reply to How can I display a unique array if it contains some repeated elements
There is a similar technique which is slightly faster (~5-7%) on larger lists:
The answer by dvergin is actually about 50% faster for lists smaller than ~2000 items.my %h; grep { !$h{$_}++ } @list;
|
---|
In Section
Seekers of Perl Wisdom