The .sort method
%addrbook.classify({ .value.substr(0,1).uc }).sort
The .sort method does what you expect -- it sorts things.
In this case, it sorts the list of pairs from .classify.
By default, pairs are sorted by their keys.
The keys here are the uppercased first letter of each name.
Thus we end up with an alphabetized list of "group Pairs"
- - key of each group first letter of names in that group
- - value is Array of 'email => name' Pairs for that group