open LOGFILE, $logfile;
@IPLogArray = <LOGFILE>;
close (LOGFILE);

@IPLogArrayCopy=@IPLogArray;	# Copy the original array

foreach $IPAddress (@IPLogArray)
{
$IPAddress=~s/(.*)-(.*)-\s//g; # Remove all other info except for IP Address
push (@ParsedIPLogArray, $IPAddress);	# Add IP address into a new array
}

# The original total number of elements in the IP Log
$totalIPLogElements=$#IPLogArrayCopy; 

for ($x=0; $x <= $#ParsedIPLogArray; $x++)
{
$hash{$ParsedIPLogArray[$x]}++; # Increment IP occurance counter

if ($hash{$ParsedIPLogArray[$x]} > 1)	
{
# Current no. of elements in the array and subtract the original total no.
$elementNumber = $x + ($#IPLogArrayCopy-$totalIPLogElements);		
splice (@IPLogArrayCopy, $elementNumber, 1);
}
}

print @IPLogArrayCopy;
