Perl 6 Cool Perl 6 #58

Case-insensitive sort

Of course, any expression can be used as the sort criteria:

> my @a = <Fruit CHERRY danish Apple berry BaNaNa apricot>;
> .say for @a.sort( { .uc } );
Apple
apricot
BaNaNa
berry
CHERRY
danish
Fruit

> my %scores = < pmichaud 52   mäsak 95   PerlJam 78 >;
> .say for %scores.sort( { .key.uc } );
mäsak   95
PerlJam 78
pmichaud         52
Copyright © 2010
http://www.pmichaud.com/2010/pres/