@ans = grep { ($_ > 0) .. 0 } @array; $found = shift @ans;