note
injunjoel
Greetings,<br />
Another way to look at this problem is to use [grep] to simply see if <c>$user[0]</c> is in your <c>@protected</c> list.
<c>
open (PROTECTED, "$protected");
@protected = <PROTECTED>;
close(PROTECTED);
#... not sure where $tag is coming from...
if (grep($_ eq $user[0], @protected)){
sock("PRIVMSG $tag:$user[0] Is A Protected User!");
}
</c>
However if you are looking for a counter of where in the list <c>$user[0]</c> appears you can add one to your [for] loop.
<c>
my $count = 0;
for(@protected){
if($_ eq $user[0]){
sock(...blah blah blah...);
last;
}
$count++;
}
print("$user[0] was found at ".$count+1." in the list.\n");
</c>
<br /><br />
-InjunJoel<br />
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-277600">
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo
</div></div>
705319
705319