http://www.perlmonks.org?node_id=172660


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:
my %h; grep { !$h{$_}++ } @list;
The answer by dvergin is actually about 50% faster for lists smaller than ~2000 items.
  • Comment on Re: How can I display a unique array if it contains some repeated elements
  • Download Code