You could always put them into a hash and then put them into an array later.

foreach(@names){
   $hash{$_} = 1;
}

my @array = keys %hash;

-----Original Message-----
From: Allison Ogle [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 8:08 AM
To: a a
Subject: Array question


Hi,

I have a datafile with a list of names like

Ana
John
Mike
Tracy
John
Luke
...
etc.

I don't know how long the list is and eventually in the list some of the
names will repeat.  I want to put these names in an array but I don't want
to repeat any names in the array and I want to keep a count of how many
times the name appears in the list.  Does anyone have any ideas or
suggestions?  Thanks,

Allison


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to