Maybe you could provide a Data::Dumper output of your structure (or part thereof) to clarify your problem.
In reply to Re: Until loop / unique by Laurent_R in thread Until loop / unique by monkini