Add UCD::num() to get safe numeric value of a string
authorKarl Williamson <public@khwilliamson.com>
Tue, 15 Feb 2011 15:37:16 +0000 (08:37 -0700)
committerKarl Williamson <public@khwilliamson.com>
Tue, 15 Feb 2011 16:27:15 +0000 (09:27 -0700)
commit7319f91d2a5083b255891bbdec7edc0bdfa49f4d
treeae85af39985bef6ef49af7557189d7d81e25f324
parentcef6a343d5e19fe2dc2c3655ecf621c8ff26f252
Add UCD::num() to get safe numeric value of a string

This function will return the numeric value of the string passed it,
and undef if the entire string has no safe numeric value.

To be safe, a string must be a single character which has a numeric
value, or consist entirely of characters that match \d, coming from the
same Unicode block of digits.  Thus, a mix of  Bengali and Western
digits would be considered unsafe, as well as a mix of half- and
full-width digits.
lib/Unicode/UCD.pm
lib/Unicode/UCD.t
pod/perldelta.pod