my %id_to_name = ( 1 => 'keith', 2 => 'rob', 3 => 'eric', 4 => 'rob', # etc. ); my %id_to_mark = ( 1 => 90, 2 => 52, 3 => 86, 4 => 71, # etc. ); #### my %scores_to_names = ( 90 => [ 'keith' ], 52 => [ 'rob', 'dave' ], # etc. );