in reply to Re^3: Finding unique elements in an array
in thread Finding unique elements in an array

I thought it looked like a nice job for List::Util, but it requires too much fiddling to make it come up with an array, so it's not really elegant. (The reason I wanted to try it is that it pre-loads $prev.)
use List::Util 'reduce'; sub uniq { return @{;reduce {ref $a or $a=[$a]; push @$a, $b if $b ne $a->[-1 +]; $a} @_}; };
So it looks like grep is the right tool.

Update: This is a little shorter version with grep:

sub uniq { return @_ ? @_[0, grep {$_[$_] ne $_[$_-1]} 1..$#_] : (); };

Caution: Contents may have been coded under pressure.