summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Unicode/UCD.pm5
-rw-r--r--lib/Unicode/UCD.t12
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm
index 96dee9a816..b28c6f7d83 100644
--- a/lib/Unicode/UCD.pm
+++ b/lib/Unicode/UCD.pm
@@ -295,6 +295,7 @@ my %BLOCKS;
sub _charblocks {
unless (@BLOCKS) {
if (openunicode(\$BLOCKSFH, "Blocks.txt")) {
+ local $_;
while (<$BLOCKSFH>) {
if (/^([0-9A-F]+)\.\.([0-9A-F]+);\s+(.+)/) {
my ($lo, $hi) = (hex($1), hex($2));
@@ -356,6 +357,7 @@ my %SCRIPTS;
sub _charscripts {
unless (@SCRIPTS) {
if (openunicode(\$SCRIPTSFH, "Scripts.txt")) {
+ local $_;
while (<$SCRIPTSFH>) {
if (/^([0-9A-F]+)(?:\.\.([0-9A-F]+))?\s+;\s+(\w+)/) {
my ($lo, $hi) = (hex($1), $2 ? hex($2) : hex($1));
@@ -493,6 +495,7 @@ my %COMPEXCL;
sub _compexcl {
unless (%COMPEXCL) {
if (openunicode(\$COMPEXCLFH, "CompositionExclusions.txt")) {
+ local $_;
while (<$COMPEXCLFH>) {
if (/^([0-9A-F]+)\s+\#\s+/) {
my $code = hex($1);
@@ -563,6 +566,7 @@ my %CASEFOLD;
sub _casefold {
unless (%CASEFOLD) {
if (openunicode(\$CASEFOLDFH, "CaseFolding.txt")) {
+ local $_;
while (<$CASEFOLDFH>) {
if (/^([0-9A-F]+); ([CFSI]); ([0-9A-F]+(?: [0-9A-F]+)*);/) {
my $code = hex($1);
@@ -643,6 +647,7 @@ my %CASESPEC;
sub _casespec {
unless (%CASESPEC) {
if (openunicode(\$CASESPECFH, "SpecialCasing.txt")) {
+ local $_;
while (<$CASESPECFH>) {
if (/^([0-9A-F]+); ([0-9A-F]+(?: [0-9A-F]+)*)?; ([0-9A-F]+(?: [0-9A-F]+)*)?; ([0-9A-F]+(?: [0-9A-F]+)*)?; (\w+(?: \w+)*)?/) {
my ($hexcode, $lower, $title, $upper, $condition) =
diff --git a/lib/Unicode/UCD.t b/lib/Unicode/UCD.t
index 9082057bbd..b9bf574d13 100644
--- a/lib/Unicode/UCD.t
+++ b/lib/Unicode/UCD.t
@@ -12,7 +12,7 @@ use strict;
use Unicode::UCD;
use Test::More;
-BEGIN { plan tests => 162 };
+BEGIN { plan tests => 164 };
use Unicode::UCD 'charinfo';
@@ -279,3 +279,13 @@ ok($casespec->{az}->{code} eq '0307' &&
$casespec->{az}->{upper} eq '0307' &&
$casespec->{az}->{condition} eq 'az After_Soft_Dotted',
'casespec 0x307');
+
+# perl #7305 UnicodeCD::compexcl is weird
+
+for (1) {$a=compexcl $_}
+ok(1, 'compexcl read-only $_: perl #7305');
+grep {compexcl $_} %{{1=>2}};
+ok(1, 'compexcl read-only hash: perl #7305');
+
+
+