"be consistent" | |
PerlMonks |
Re: add values with hashby DACONTI (Scribe) |
on Mar 11, 2008 at 15:00 UTC ( [id://673524]=note: print w/replies, xml ) | Need Help?? |
Hi steph, in order to solve your problem I recommend you first to look at hashes of hashes and autovivification in some perl book. (For ex. Programming Perl) Personally, for problems of your kind, I like to use hash references like in the example below: By building hashes in this way I can easily write very complex hash structures In addition if you look carefully at the example above, you will remark that there is this kind of convention: metadata->data->'detail metadata'->'detail data' . If you do like that you have a single structure to which you can add at any time new dimensions without loosing degrees of freedom. It shouldnt be too difficult to match this strategy to your actual problem. Best Regs, Davide.
In Section
Seekers of Perl Wisdom
|
|