in reply to Populating a hash-ref from multiple arrays with slice?
The problem is that you have to store multiple values into an anonymous array ref, and hash slices implicitly loop on lists, not a scalar that points to an anonymous array ref. How about the old fashioned way instead?
use strict; use warnings; use Data::Dumper; my %hash; my @array1 = qw"some_unique_key1 some_unique_key2 some_unique_key3"; my @array2 = qw"meta_data_1 metadata_2 metadat_3"; my @array3 = qw"submitted_date1 submitted_date2 submitted_date3"; for (0 .. $#array1) { $hash{ $array1[$_] } = [ $array2[$_], $array3[$_] ]; } print Dumper \%hash;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|