in reply to Re: Incrementing a hash of array value
in thread Incrementing a hash of array value

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.