in reply to How to find number of unique elemenst in array

Life is too short to spend it reinventing wheels - use CPAN. In this case the various List modules will likely have what you need. Enjoy.


Perl's payment curve coincides with its learning curve.
  • Comment on Re: How to find number of unique elemenst in array

Replies are listed 'Best First'.
Re^2: How to find number of unique elemenst in array
by ysth (Canon) on Nov 27, 2008 at 20:37 UTC
    Counting repeated elements isn't exactly reinventing a wheel. What List modules/functions did you have in mind? (My List::Util::reduce solution was by way of a joke; I hadn't seen your post when I wrote it.)

      Oh ysth! Look at the OP's sig, then look again at my reply. ;)

      Although actually List::Uniq would seem to fit quite well.


      Perl's payment curve coincides with its learning curve.