I'm reading in lines of text, and extracting the
relevant parts of it.  These relevant parts are then
being pushed onto an array.  My trouble is that these
parts are a maximum of 24 unique names.  However, when
pushed onto the array, there is no mechanism for
comparison where the repeated names are skipped.  I'm
not sure how to do it.  Here's the code I have:

while (<STATS>)
{
 if ($_ =~ /\[($team)\] ($player)/)
 {
  if ($1 eq "SAN")
        {
         push (@SAN, $2);
#unless ($2 eq $SAN[i]) #I need a foreach loop here
#that will give the unless a $SAN[i] to compare
#against the $2, I'm just not sure how to write it. 
        }

        elsif ($1 eq "PHX")
        {
         push (@PHX, $2);
        }
         
        print "$1\t";
  print "$2\n";
}
}
foreach (@SAN)
{
 print "Spur roster: $_\n";
} 

In the end, I want @SAN to have all the unique names
within the file.  Any ideas?

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to