[Vienna-pm] locales, umlaute, sortierung ...

Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 daxim at cpan.org
Tue Nov 9 03:51:52 PST 2010


> einzig, den space versteh ich auch nicht. ....
Ist so im [Standard](http://en.wikipedia.org/wiki/Unicode_collation_algorithm) 
vorgesehen. Das ganze Thema ist interessant. 
<http://conferences.yapceurope.org/gpw2010/talk/2554>

POSIX/locales sind mir zu global. So geht's elegant:

#!/usr/bin/env perl
use 5.010;
use utf8;
use strictures;
use Unicode::Collate;

say for Unicode::Collate->new(preprocess => sub {s/^\s+//})->sort(
    map lc, (
        qw(ampel ampele ösen zöse ampez ampex),
        'ampel vorrang', 'öse nöse', 'Öse nöse', 'ampe wampe', ' sowas',
        qw(ose otter)
    )
);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.pm.org/pipermail/vienna-pm/attachments/20101109/3ac11101/attachment.bin>


More information about the Vienna-pm mailing list