Something like this ought to work:
my( $color, $fruit ) = @{$hoa->{keytwo}}[$idx_color, $idx_fruit];
There's nothing wrong with your use of a HoA. It is true, however, that a lot of thought should go into selecting the construction of complex datastructures. The right layout makes all the difference in code complexity/simplicity.
Dave
In reply to Re: HOA with array slice?
by davido
in thread HOA with array slice?
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |