Sorry for the dubious code. It's actually a long program. So I just typed the above code from memory hoping it would compile. My apologies! Here is what i am trying to achieve. I have a number of strings which I would like to print in a minimal hierarchical format. Instead of Listing all expanded variations on M01 (ie:
M01.001
M01.001.111
M01.001.111.111
M01.001.111.111.113
...
...
...
etc
I would only like to print "M01.001 +". Then the user can click on the plus sign to expand and view the next level of the tree structure, the children that is. Orphaned nodes would still show but parents would be assigned a plus sign for expansion. The only way I can do this is by counting all occurrences of a certain string in a data reduction technique. I am using a hash of arrays to do this. The first value of the HoA is a string (ie $hash{$k}[0]) in the example; the second element is the incremented number which I autovivify (ie $hash{$k}
1). I hope this makes sense. Is there a better technique to do this? Thanks.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.