Sure enough: I have values set then it tries to place the nested hash in the same level.
Here is some logs of the last set of arrays sent to the sub:
02-28-2001 15:18:46 |69 15
02-28-2001 15:18:46 |69 16
02-28-2001 15:18:46 |69 18
02-28-2001 15:18:46 |69 15 14
02-28-2001 15:18:46 |69 18 17
02-28-2001 15:18:46 |69 18 19
02-28-2001 15:18:46 |69 15 14 13
02-28-2001 15:18:46 |69 15 14 13 12
02-28-2001 15:18:46 |69 15 14 13 12 11
02-28-2001 15:18:46 |69 15 14 13 12 11 10
$hash{69}{15}
$hash{69}{18}
Are set first, so all the others are ignored. When really, the least important are the first ({69}{15} & {69}{18}) with the last in the set being critical:
$hash{69}{15}{14}{13}{12}{11}{10}
$hash{69}{18}{17}
$hash{69}{18}{19}
$hash{69}{16}
What the script is doing is going through some DB entries and trying to draw a tree from the info it finds. $hash{69}{15}{14}{13}{12}{11}{10} represents a whole leg. My ultimate goal is to draw out the pyramid. I figure that if I could load all the values into the hash, I could just do a recursive iteration of the hash to print out the tree. But since $hash{69}{15} = 1 is set first, the rest of the program errors.

In reply to Re: How do I populate a ML hash from an array? by unixdown
in thread How do I populate a ML hash from an array? by unixdown

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.