Thank you both for your replies. What about sorting words in one
language, is Perl's sort() good enough? I'm wondering, since language
one of sort()'s arguments.
First we need to define "good enough"... again, if you are sorting
"simple" English or Hawaiian, you are probably fine. But as soon
as your "words" contain real-life complications like
- letters like é or or ö or æ or ...
- beyond-Latin-1-letters like Ă or Ł or Б or א or अ or ぁ or ... -
- acronyms and the like
- do all the characters matter or just the letters
- sorting mixed letters and digits
- Roman numbers
you are on your own. For the first item the use of the locale pragma
as long as your data is 8-bit and in one locale. As soon as data
Perl will as far as I know ignore localeness for sorting.
If you find yourself wanting some complex sorting, look into CPAN, what
can find from search.cpan.org with "sort", for example Sort::ArbBiLex
Jarkko Hietaniemi <jhi(_at_)iki(_dot_)fi> http://www.iki.fi/jhi/ "There is this
biologist word we use for 'stable'. It is 'dead'." -- Jack Cohen