2008/4/1 Jay Savage <[EMAIL PROTECTED]>:
snip
>     my ($last) = $number =~ /.*(\d)/;
>
>  Let Perl worry about what is and isn't a digit.
snip

Unfortunately, with the rise of UNICODE, \d is no longer what one
expects* ([0-9]).  It now includes all characters marked as digits in
UNICODE.  This includes characters like "\x{1813}" (MONGOLIAN DIGIT
THREE).  The \w character class also no longer matches [a-zA-Z0-9_],
but instead matches any character marked as a word character by
UNICODE; however, this is much less of a problem since, unlike digits,
a character is still a character (try adding "\x{1813}" + 1).

* note, you can get the old behavior back by using the bytes pragma.

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to