Your problem seems well-suited to be treated with object-oriented techniques.
Hide your data structures into an object, and create methods to get the views you need. You could then implement methods that reorder your hash on the fly or, if memory is not an issue, implement a cache that avoid recalculation of the same hash when not needed -but that would bring you back to the cumbersome and tedious problem to create new hashes for each dimensional rework of the original dataset :-).
Let me know if I should go further and drop some quick-and-dirty code you can use as starter.
Ciao!
--bronto
# Another Perl edition of a song:
# The End, by The Beatles
END {
$you->take($love) eq $you->made($love) ;
}
In reply to Re: creating multiple views of a hash by reordering its key and values
by bronto
in thread creating multiple views of a hash by reordering its key and values
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |