in reply to Sorting measurements

perldsc - Perl Data Structures Cookbook, is a great reference for complex data structures, it's well worth a read. It contains lots of advice & examples, and should help you with your problem.

BTW, perl ships with lots of documentation, try 'perldoc perl' for a starting point.