megaurav2002 has asked for the wisdom of the Perl Monks concerning the following question:
based on this hash, i want to build like levels of directory :key=>value 1=>1 2=>1 3=>1 4=>2 5=>3 6=>4 7=>4 8=>8 9=>8
explanation: 1=>1 therefore 1 is root. Same is with 8. 2 & 3 are sub levels of 1 as shown in diagram. Do i need recursion for this? because number of elements is not fixed. Any hints how to do this? Thanks! Gaurav Talwar1 - 2 - 4 - 6 - 7 - 3 - 5 8 -9
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to build directory
by greatshots (Pilgrim) on May 22, 2007 at 09:27 UTC | |
by Skeeve (Parson) on May 22, 2007 at 09:52 UTC | |
by megaurav2002 (Monk) on May 22, 2007 at 09:56 UTC | |
by naikonta (Curate) on May 22, 2007 at 13:16 UTC |