@array = (...some 1_000_000 element array...); $search_for = "blah"; my $index = 0; while ( $array[$index] != $search_for ) { $index++ }