@stuff = (a, 1, b, 2, c, 3, d, 3); push(@unique, foo, grep { $seen{$_}++ } @stuff); %unique = @unique; while ( ($key, $value) = each %unique) { print "$key => $value\n"; }