One of the classic ways is to assign each element as a key of a hash.

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

@array = keys %hash;

-----Original Message-----
From: Kirby_Sarah [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 12:04 PM
To: [EMAIL PROTECTED]
Subject: Down and dirty duplicate deleter


Hi, 

I have instances where I want to delete duplicate elements out of an array.
Is there an easy way to do this?

-Sarah


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

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

Reply via email to