Perl: the Markov chain saw | |
PerlMonks |
Re^3: ordering array of sentencesby choroba (Cardinal) |
on Nov 13, 2012 at 16:58 UTC ( [id://1003665]=note: print w/replies, xml ) | Need Help?? |
As usual in functional programming, read from right to left (or bottom to top):
The map changes the sentences to arrays of arrays. Each such an array has two elements: the word to sort on and the original sentence. sort just sorts the arrays according to their first element, i.e. the sort word. map transforms the arrays back to sentences.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
In Section
Seekers of Perl Wisdom
|
|