I have been going cross-eyed over this for the last hour or so. Each time I re-read the Doc on
use locale; I come up with a different opinion of how this code snippit should work.
$x = "\x{9e}"; # A-acute accent
{
use local;
($x =~ /a..zA..Z/) ? print "true\n" : print "not true\n";
}
The code I am debugging takes a list of words and sorts them "alphabetically". Most of the time it works as expected, but now we are starting to get a few French-Canadian words in the corpus and "A accent-egu"(I thinks that's right, I am not a Francophone) falls at the end of the 'normal' alphabet (following Z), rather than sorting between 'A' and 'B' where I am told it should.
I initially looked at the code and said "/self, it's a locale issue" and started reading the Doc on the 'locale' pragma. Three cups of coffee later, I still do understand why I'm not getting the 'correct' sort. I am obviously missing something basic here, but what?
----
I Go Back to Sleep, Now.
OGB
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.