You may be interested in List::Util::first:
use List::Util qw( first ); my $pro = first { $user[0] eq $_ } @protected; do_stuff_with( $pro ) if defined $pro;
Considering the rest of your code, however, you might want to look into a hash for storing your protected users persistently rather than reading a file every time someone joins. See perldata for info on hashes.
In reply to Re: reiterateing over array
by kyle
in thread reiterateing over array
by k0rn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |