in reply to reiterateing over array
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reiterateing over array
by k0rn (Acolyte) on Aug 19, 2008 at 20:33 UTC | |
by alexm (Chaplain) on Aug 19, 2008 at 21:35 UTC | |
by blazar (Canon) on Aug 20, 2008 at 18:04 UTC | |
by k0rn (Acolyte) on Aug 19, 2008 at 20:37 UTC | |
by blazar (Canon) on Aug 20, 2008 at 18:20 UTC |