Perl 6 Cool Perl 6 #23

Consider the following Perl 6 program...

Suppose we have an input file containing email addresses and names:

pmichaud@pobox.com      Patrick R. Michaud
allison@parrot.org      Allison Randal
jnthn@jnthn.net         Jonathan Worthington
larry@wall.org          Larry Wall
jesse@fsck.org          Jesse Vincent
audreyt@audreyt.org     Audrey Tang

What will the following do?

my %addrbook = $*IN.lines.map( { .split(/\s+/, 2) } );

for %addrbook.classify({ .value.substr(0,1).uc }).sort -> $g {
    say "{$g.key}:";
    .say for $g.value».invert».fmt("  %-32s %s");
}
Copyright © 2010
http://www.pmichaud.com/2010/pres/