for (0 .. $#CD_new_a_v_d_D) { if ($key eq $CD_new_a_v_d_D[$_]) { print "$key - $value (at $_)\n"; } }