my %hash; foreach $key $value (@keys) { $hash($key) = $value; } [download]
In reply to multiple local vars in a foreach loop by shawnkielty