for my $key ( sort { ([split '\t', $students{$b}]->[1]) <=> ([split '\t', $students{$a}]->[1]) } keys %students) { print $students{$key}, $/ }