Jump to content

Letter frequency: Difference between revisions

m
→‎{{header|Perl 6}}: style twiddles
(→‎{{header|Perl 6}}: Update, add example usage)
m (→‎{{header|Perl 6}}: style twiddles)
Line 2,067:
=={{header|Perl 6}}==
In perl6, whenever you want to count things in a collection, the rule of thumb is to use the Bag structure.
<lang perl6>.&ws.say for (bag slurp».comb).Bag.sort: -*.value;
 
sub ws ($pair) {
10,339

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.