Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
It sounds like you may be looking for a basic tutorial on the definition of a tree structure. If that is so, I recommend having a look at Wikipedia (tree structures) which I'm finding has good introductions to basic computer science concepts such as this these days..

As an aside, I think Perl lends itself quite naturally to tree structures. Having references makes building trees very simple. For example, consider a table of contents:

my %contents = ( 1 => [ 'Introduction', undef ], 2 => [ 'Design', { 1 => [ 'Wheels', undef ], 2 => [ 'Frame', undef ], 3 => [ 'Electronics', { 1 => [ 'Dashboard', undef ], 2 => [ 'Fuel Injection', undef ], }, 4 => [ 'Petrol Tank', undef ], }, 3 => [ 'Summary', undef ], );

Merely defining things these ways is, by definition, a tree. If references are tripping you up, then read about pointers.. and re-read until you become more comfortable with this concept.


In reply to Re: Categories. Table of Contents. Trees? by monarch
in thread Categories. Table of Contents. Trees? by harleypig

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (10)
    As of 2014-10-22 22:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (122 votes), past polls