in reply to searching an array
You want grep
die "bla bla\n" unless grep { $_ eq $name } @array
Or if you want to avoid the overhead of looking at the whole array look at first() in List::Util.
s/if/unless/ - thanks frodo72
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: searching an array
by phaylon (Curate) on Jan 03, 2006 at 15:17 UTC | |
by jdhedden (Deacon) on Jan 03, 2006 at 15:43 UTC | |
by phaylon (Curate) on Jan 03, 2006 at 15:49 UTC |