in reply to Populating a hash with two arrays
Or with mapmy %hash; @hash{@people} = @jobs;
Finally a Haskell-esque approachmy %hash = map { $people[$_] => $jobs[$_] } 0 .. $#people;
All these examples assume both arrays are of the same length and that each index in the arrays correspond to the relative index in the other array (e.g $people[0] corresponds to $jobs[0]).use Functional; my %hash = @{ zip(\@people, \@jobs) };
_________
broquaint
|
|---|