"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello wise monks, I'd like to have some syntactical sugar to wrap a datastructure that I have. What I'd like to do is say: and have custom behaviour, based on the values of 'x', 'y', and 'z', and the dimension specified. In other words, if FETCH and STORE took multiple arguments for keys (along the lines of the following:) then I'd just write my code in the MultiHash::STORE and ::FETCH methods and be very happy. But these methods don't work that way. So far, I've tried recursively nesting tied hashes (but that didn't work; the recursive FETCH call apparently received no argument for $key). I've looked at Tie::MLDBM and Tie::RefHash for possible insight but I didn't learn much, and both searching Google and the PerlMonks archive hasn't helped me. How can I get around this problem? Thanks in advance, In reply to How to tie multilevel (multidimensional) hash? by mikezone
|
|