use 5.012; use warnings; my @array = qw/zero one two three four five six/; my %hash; while (my ($idx, $val) = each @array) { $hash{$idx} = $val };