$seen{$_}++ or push @uniq, $_ for @orig; # or @uniq = grep !$seen{$_}++, @orig;