in reply to Finding the index of a specific element in an array.

One way is to use List::MoreUtils:
use warnings; use strict; use List::MoreUtils qw(firstidx); my @array = (2,4,7,5,8); printf "item with index %i in list is 7\n", firstidx { $_ == 7 } @arra +y; __END__ item with index 2 in list is 7