Skip to content

Commit c34c211

Browse files
vaitkuskhwilliamson
authored andcommitted
lib/Unicode/UCD.pm: update num() usage example
A combination of two Rumi digits is not considered a valid decimal number by num() thus resulting in an undef result value. While such behaviour is properly documented in the num() description and thus expected, it might be better to give an example that returns a proper numeric value. An equivalent change was made to an example in pod/perlunicook.pod.
1 parent 15cbd20 commit c34c211

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

charclass_invlists.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Unicode/UCD.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use warnings;
55
no warnings 'surrogate'; # surrogates can be inputs to this
66
use charnames ();
77

8-
our $VERSION = '0.78';
8+
our $VERSION = '0.79';
99

1010
sub DEBUG () { 0 }
1111
$|=1 if DEBUG;
@@ -113,7 +113,7 @@ Unicode::UCD - Unicode character database
113113
my $unicode_version = Unicode::UCD::UnicodeVersion();
114114
115115
my $convert_to_numeric =
116-
Unicode::UCD::num("\N{RUMI DIGIT ONE}\N{RUMI DIGIT TWO}");
116+
Unicode::UCD::num("\N{VAI DIGIT ONE}\N{VAI DIGIT TWO}");
117117
118118
=head1 DESCRIPTION
119119

lib/unicore/uni_keywords.pl

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pod/perlunicook.pod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ convert such strings manually.
452452
say "@nums"; # 12 4567 0.875 1000000000000
453453

454454
use charnames qw(:full);
455-
my $nv = num("\N{RUMI DIGIT ONE}\N{RUMI DIGIT TWO}");
455+
my $nv = num("\N{VAI DIGIT ONE}\N{VAI DIGIT TWO}");
456+
say $nv; # 12
456457

457458
=head2 ℞ 29: Match Unicode grapheme cluster in regex
458459

regcharclass.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

uni_keywords.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)