in reply to find position of element of array
use List::MoreUtils qw(firstidx); my @array = ("a","b","c","d"); my $index = firstidx { $_ eq "c" } @array; my $wanted = $array[$index - 1];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: find position of element of array
by Perl Mouse (Chaplain) on Nov 07, 2005 at 10:43 UTC |