in reply to How to transform a matrix into a hash??

Not sure if it's simpler than your way of doing it, but I think something like this would work:
my $HoH = {}; foreach my $array (@AoA) { $HoH->{ $array->[0] }->{ $array[1] }->{ $array->[2] } = 1; }
But I haven't tested it, so YMMV.