[kw-pm] unique

Eric Maki eric at uc.org
Wed Apr 19 10:01:05 PDT 2006


> @multiples = grep {
>     $_ eq $prev
>         ?? ( ++$count == $min_count )
>         :: ( ($prev = $_), ($count = 0) )
>     } @sorted;

You are a bit ahead of the curve, John.  That is the Perl6
ternary-if-op.

Points, though, for the intentional use of the c-style comma
operator.  The last ten times I saw that, it was because my
coworker was getting this weird 'constant in void-context' error
that he hoped I might have time to look at.

Eric


More information about the kw-pm mailing list