You could use a hash instead.
Set the key to the ipvalue and the value to 1.
If ($ips{$thisip}) {
}
HTH
Paul
-----Original Message-----
From: Dan Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 12:58 PM
To: [EMAIL PROTECTED]
Subject: Is there a function to see if something is an element of an
array?
I have a long list of IP addresses I am going to be reading in (using
regexps) and then seperating out into a list of IP addresses. I don't
want the IP addresses to be printed if they are not unique.
Is there a way to check if a string already has an element in a stack?
i.e. push @stack, $_ if is_unique($_, @stack); ?
Or would I have to code that myself?
-Dan
--
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]