uses a hash!sub uniq (@) { my %h; map { $h{$_}++ == 0 ? $_ : () } @_; }
Whilst in principal using a module is often a good thing, maybe it would be better if the OP understood what was going on under the hood first?
Just my not so humble opinion.
In reply to Re^2: finding the distinct elements in an array
by jdtoronto
in thread finding the distinct elements in an array
by beginr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |