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