I guess this is not possible by design, but just in case I am missing something...
Is there a clever/efficient way to make this work (other than with a loop)?
my %hash = map { delete $_->{id_1} => { delete $_->{id_2} => $_ } } @ary_of_hrefs;It should produce the same result as the below (except not a reference)
my $hash; foreach my $href (@ary_of_hrefs) { my $id_1 = delete $href->{id_1}; my $id_2 = delete $href->{id_2}; $hash->{$id_1}->{$id_2} = $href; }
In reply to map into a multidimensional hash by nikmit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |