for my $index (0..$#array_of_keys){ $hash{$array_of_keys[$index]}=$array_of_values[$index]; }