Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've got a project where I basically need to read a tree from one source, then re-write it as html (nested UL's). What, in your opinion, would be a good place to start with a design for data representation? hashes? arrays? arrays of hashes? hashes of arrays?

Replies are listed 'Best First'.
Re: Perl Trees
by plaid (Chaplain) on Feb 25, 2000 at 00:48 UTC
    If you want to construct a set of nested ULs out of the data, I'm assuming you'd only need values, not the key/value pairs of a hash. I'd recommend using arrays of arrays, for which there is a very helpful manpage, perllol
      hmmm... I was going to respond that no, these UL's would be text and URL pairs but your response made me think more about it. each item in the array could itself contain the entire a href tag, it's text and the /a as well. no need to maintain them seperately. easier than i had previously been thinking. thanks for simplifying my thoughts.