[kw-pm] unique

Dave Carr dc0955 at gates.com
Wed Apr 19 06:31:29 PDT 2006


>> $prev = 'nonesuch';
>>
>> @uniq = grep($_ eq $prev && (($prev) = $_), @sorted);

I know I know...it should be
@uniq = grep($_ ne $prev && (($prev) = $_), @sorted);

>Finding Perl snippets and using them without knowing what they're doing
/ >how they work will only bite you in the ass.  That includes the
snippet I >just gave here.  Learn how it works before you use it.

Just because I'm stupid is it right for you to assume I don't know what
the snippet does or how it works? ;)

- Lloyd


More information about the kw-pm mailing list