in reply to A more complete Unique()
in thread Optimize - Checking multiple occurences of elements in an array

Very complicated and breaks if a literal __NOT_DEFINED__ appears in the input data. Contrary to the posts so far, the standard idiom is not just using a hash, but combining it with grep:
my %seen; my @unique = grep !$seen{$_}++, @array;
This retains order and does not break references. It does have the problem with empty strings vs undefs cancelling each other away when they (probably) shouldn't, but that's easily fixed:
my (%seen, $seen_undef); my @unique = grep defined ? !$seen{$_}++ : !$seen_undef++, @array;

Makeshifts last the longest.