[kw-pm] unique

Rick Price rprice at freeshell.org
Wed Apr 19 08:11:32 PDT 2006


Why are you trying to do that?

Rick



[=============================]

   Big whorls have little whorls,
   Which feed on their velocity;
   And little whorls have lesser whorls,
   And so on to viscosity.

   Lewis Richardson


On Wed, 19 Apr 2006, Dave Carr wrote:

> Found this snippet to do unique on a sorted array
>
>
>
> $prev = 'nonesuch';
>
> @uniq = grep($_ eq $prev && (($prev) = $_), @sorted);
>
>
>
> How could I modify this to require a string to occur at least two times
> to be included in the output array, in other words single occurrences
> will be skipped?
>
>
>
> - Lloyd
>
>


More information about the kw-pm mailing list