# Create a list of student IDs by taking the sorted # list of anonymous arrays and returning the second # element of each. map { $_->[1] } # Sort the list of anonymous arrays (created below) # numerically, using the first element in the array # (the GPA). sort { $a->[0] <=> $b->[0] } # For each key in %students, create an anonymous array: # The first element is the GPA, obtained by taking # the second element of the list created by splitting # the value of $students{$_} on the tab, and the second # element is the student ID. map { [ (split( "\t", $students{$_} ))[1], $_ ] } keys %students )