my @keys = qw(b d a c); my @values = qw(200 100 30 40); my %hash; @hash{@keys} = @values; print Dumper \%hash;