in reply to Re^4: perllocale weirdness, bug, or...?
in thread perllocale weirdness, bug, or...?
The problem is that I want to _reproduce_ under Perl the same order relation that the system level sort uses
What problem? You should have checked what order the system's sort uses.
$ cat >data aaa2000@yahoo.com aaa_2000@yahoo.com aaa2000 aaa_2000 $ export LC_COLLATE=en_US.UTF-8 $ sort data aaa2000 aaa_2000 aaa_2000@yahoo.com aaa2000@yahoo.com $ perl -le'use locale; chomp(@a=<>); print for sort @a;' data aaa2000 aaa_2000 aaa_2000@yahoo.com aaa2000@yahoo.com $ export LC_COLLATE=C $ sort data aaa2000 aaa2000@yahoo.com aaa_2000 aaa_2000@yahoo.com $ perl -le'use locale; chomp(@a=<>); print for sort @a;' data aaa2000 aaa2000@yahoo.com aaa_2000 aaa_2000@yahoo.com
Whether the order makes sense or not, it's doing exactly what you want.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: perllocale weirdness, bug, or...?
by Krambambuli (Curate) on Oct 21, 2010 at 10:08 UTC | |
by ikegami (Patriarch) on Oct 21, 2010 at 16:01 UTC | |
by choroba (Cardinal) on Oct 22, 2010 at 11:21 UTC | |
by Krambambuli (Curate) on Oct 22, 2010 at 12:20 UTC | |
by choroba (Cardinal) on Oct 22, 2010 at 12:33 UTC |
In Section
Seekers of Perl Wisdom