in reply to HoH question

How to Ask a Datastructures Question (with Test::More) may give you further ideas on techniques for disentangling and debugging your data structures.