Removing duplicate entries from an array

2002-09-20 Thread Griggs Rob
Hi All, Whats the easiest way to remove duplicate entries from an array. Below is a script that removes ip addresses from a log file and adds them to an array. I then check the array to see if the value is already present and if it is i set a flag($exists) and then push that value into the array

Re: Removing duplicate entries from an array

2002-09-20 Thread Sudarshan Raghavan
On Fri, 20 Sep 2002, Griggs Rob wrote: > Hi All, > > Whats the easiest way to remove duplicate entries from an array. Below is a > script that removes ip addresses from a log file and adds them to an array. > I then check the array to see if the value is already present and if it is i > set a fl

Re: Removing duplicate entries from an array

2002-09-20 Thread Robin Cragg
How about.. if(/\[(\d+\.\d+\.\d+\.\d+)\].+reject=550/) { $IP{$1}++; } the your array of unique IPs is just keys %IP R At 14:14 20/09/2002 +0100, Griggs Rob wrote: >Hi All, > >Whats the easiest way to remove duplicate entries from an array. Below is a >script that removes i