joshpk105 has asked for the wisdom of the Perl Monks concerning the following question:
This is a conceptual data structure problem. I would love to hear the answers if anyone has any ideas.
You have an array of arrays, turn it into a single hash of hashes where the final element of each array is the value and each previous element in order are the keys to get to that value.
Desired effect Example: IN: Array of Arrays: (0=>(a,b,e,d), 1=>(a,b,c,f), 2=>(d,h,f), 3=>(d,i,g)) OUT: Hash: $out{a}{b}{e} = d $out{a}{b}{c} = f $out{d}{h} = f $out{d}{i} = g
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Complex Hashing
by SuicideJunkie (Vicar) on Oct 28, 2011 at 17:47 UTC | |
by joshpk105 (Initiate) on Oct 28, 2011 at 19:29 UTC | |
by joshpk105 (Initiate) on Oct 28, 2011 at 18:10 UTC | |
|
Re: Complex Hashing
by Anonymous Monk on Oct 28, 2011 at 17:51 UTC |