use List::MoreUtils qw(firstidx); my @array = ("a","b","c","d"); my $index = firstidx { $_ eq "c" } @array; my $wanted = $array[$index - 1];
In reply to Re: find position of element of array
by tirwhan
in thread find position of element of array
by perlbeginner10
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |