Thanks for the help
My tree-like data may look like this:

3160
  |---8500010
  |---8500020
  |      |----8500021
  |      |       |----8500121
  |      |       \----8500122
  |      |----8500022
  |      \----8500023
  |              |----8500024
  |              \----8500025
  |---8500021
  |       |---8500121
  |       \---8500122
  \---8500030
3171
|----2800010 |----2800020 | \----8500025 |----8500010 |----8500020 | |----8500021 | | |----8500121 | | \----8500122 | |----8500022 | \----8500023 | |----8500024 | \----8500025 \---8500023 |----8500024 \----8500025

8500025 belong to 3160 and 3171
8500020 belong to 3160 and 3171

It can be printed as this:

3160
  |---8500010
  |---8500020
  |---8500021
  \---8500030
3171
|----2800010 |----2800020 | \----8500025 |----8500010 |----8500020 \---8500023

The table may like this:
-------------------------
 parentid    |   iiem id
-------------------------
             |    3160
  3160       |  8500010
  3160       |  8500020
  8500020    |  8500021
  8500021    |  8500121
  8500021    |  8500122
  8500020    |  8500022
  8500020    |  8500023
  8500023    |  8500024
  8500023    |  8500025
  3160       |  8500021
  3160       |  8500030
             |    3171
  3171       |  2800010
  3171       |  2800020
  2800020    |  8500025
  3171       |  8500010
  3171       |  8500020
  3171       |  8500023
---------------------------

I don't know which data stucture i should use.

In reply to Re: Re: Tree module select by wichard
in thread Tree module select by Anonymous Monk

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.