in reply to Hash and arrays
my @k = ("a", "b", "c"); my @v = (1, 2, 3); my %h = map { $k[$_] => $v[$_] } (0..$#k); [download]
Or, in a similar way, use a hash slice to populate the hash
#!/usr/bin/perl use strict; use warnings FATAL => "all"; use Data::Dumper; my @k = ("a", "b", "c"); my @v = (1, 2, 3); my %h; @h{@k} = @v; print Dumper \%h; __END__ output $VAR1 = { 'c' => 3, 'a' => 1, 'b' => 2 }; [download]
cheers
thinker