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


in reply to Remove duplicate strings from an array

This is almost a FAQ.

sub uniq { my %h; return grep { !$h{$_}++ } @_ }