use List::MoreUtils qw(firstidx); my @array = ("a","b","c","d"); my $index = firstidx { $_ eq "c" } @array; my $wanted = $array[$index - 1];