my $i = 0; foreach my $match(@exonic_matches) { $value = $exon_ID[$i]; $col = $exon_left{$value}; #... }