|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Reading an arbitrary hierarchy into a hash treeby XPhiNermal (Initiate) |
| on Aug 07, 2001 at 01:49 UTC ( #102631=perlquestion: print w/ replies, xml ) | Need Help?? |
|
XPhiNermal has asked for the
wisdom of the Perl Monks concerning the following question:
I need to read in a plain text file representing an arbitrary hierarchy of elements, where the elements are separated by newlines and the hierarchy structure is defined by tabs, like so:
I would like to have my program generate the following hash tree from that text data: I have contemplated various recursive and iterative approaches to this problem, but have yet to come up with anything viable (ergo no code here). Has anyone here done something similar before, or have a good idea of how to do it? Thanks in advance, Bill PS: if it makes a difference in how you would respond to such a question, I'll tell you that I'm proficient with C/C++, but am a relative beginner with Perl.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||