The .classify method
%addrbook.classify({ .value.substr(0,1).uc })
- This results in a list of Pairs with the keys being the capitalized first letter of each name, and values are all of the names beginning with that letter.
(
"P" => ["pmichaud\@pobox.com" => "Patrick R. Michaud"],
"J" => ["jnthn\@jnthn.net" => "Jonathan Worthington",
"jesse\@fsck.org" => "Jesse Vincent"],
"A" => ["allison\@parrot.org" => "Allison Randal",
"audreyt\@audreyt.org" => "Audrey Tang"],
"L" => ["larry\@wall.org" => "Larry Wall"]
)