in reply to How to find the index of an element in an array?
@foo=('a','b','c', 'd', 'e', 'f', 'g', 'h', 'i', 'g'); @idx = grep { $foo[$_] eq 'g' } (0..$#foo); print "@idx"; #6 9 [download]