my %Gene; for my $index (@gene) { $Gene{$gene[$index]} = $gene[$index+1] if $index%2; }