use strict; my @a = qw(a b c d e f); my @n = qw(1 2 3 4 5 6); my %hash; @hash{@a} = @n; print "$hash{a} $hash{e}\n\n";