in reply to Unique values in array

Or, if you do need to keep the order, try
foreach (@values) { print "$_\n" unless $seen{$_}++; }

The %seen hash keeps track of which elements you've seen before, and only prints ones which haven't been seen.