use strict; my %hash=map {@array1[$_]=>@array2[$_]} 0..$#array1;