my ($i, @a2); $a2[ $array[$_] ]=$_ for 0..$#array; for ($i = $find; $i >0; $i--) { last if defined $a2[$i]; } print "Method 2: $i \n";