Seems like an exercise in linked list data structure that accounts for multiple occurrences of a value.
For your ideal hash reference structure when you are populating the hash reference, (1) stick a "count" key, value of which is incremented (& starts with 1) just in the manner you would add "B" key of a hash reference value for "A" key; (2) assign the array reference value also a key to have a valid hash reference.
In reply to Re: Count number of elements in HoH and sum them for other keys
by Anonymous Monk
in thread Count number of elements in HoH and sum them for other keys
by Sosi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |