On Oct 5, Charles Farinella said:

I have a list of 15,000+ items in a tab separated list.  I am putting
all the values into an array, and I need to look through all $array[0]
for duplicates and am not sure how to proceed.  Help?

Whenever you think of frequency, or duplicates, or unique values, think of using a hash.

The basic idea is:

  for (LIST) {
    $frequency{$_}++;
  }

and now your %frequency hash tells you how many times a particular element in the LIST was seen.

  perldoc -q duplicate

Once you've looked that over and come up with some code, show us and we'll guide you from there.

--
Jeff "japhy" Pinyan        %  How can we ever be the sold short or
RPI Acacia Brother #734    %  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to