Perl 6 Cool Perl 6 #28

The .classify method

    %addrbook.classify({ .value.substr(0,1).uc })
(
  "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"]
)
Copyright © 2010
http://www.pmichaud.com/2010/pres/