summaryrefslogtreecommitdiff
path: root/lib/utf8_heavy.pl
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-15 13:51:11 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-15 13:51:11 +0000
commit03138300d2ba00b7ff75af983974ea0770374802 (patch)
treef8f96e1c0f9910bc1789f7cdd7fd77a35dd80ff7 /lib/utf8_heavy.pl
parent92e830a9086d75f086574c378b1c63ff2e00edcf (diff)
downloadperl-03138300d2ba00b7ff75af983974ea0770374802.tar.gz
Additional utf8_heavy.pl tweak from Jeffrey.
p4raw-id: //depot/perl@14272
Diffstat (limited to 'lib/utf8_heavy.pl')
-rw-r--r--lib/utf8_heavy.pl15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl
index e82c06b520..3f14afece2 100644
--- a/lib/utf8_heavy.pl
+++ b/lib/utf8_heavy.pl
@@ -97,9 +97,9 @@ sub SWASHNEW {
## If so, the associated name is the file we need.
##
my $prefix = substr(lc($istype), 0, 2);
- if (exists $utf8::IsPat{$prefix})
+ if (my $hashref = $utf8::IsPat{$prefix})
{
- while (my ($pat, $name) = each %{$utf8::IsPat{$prefix}})
+ while (my ($pat, $name) = each %{$hashref})
{
print "isprefix = $prefix, Is = $istype, pat = $pat\n" if DEBUG;
##
@@ -113,6 +113,7 @@ sub SWASHNEW {
if ($istype =~ /^$pat$/i)
{
$file = "unicore/Is/$name.pl";
+ keys %{$hashref}; ## reset the 'each' above
last GETFILE;
}
}
@@ -148,16 +149,22 @@ sub SWASHNEW {
last GETFILE;
}
+ ##
+ ## Need to look at %utf8::InPat (loaded from "unicore/In.pl")
+ ## to see if there's a regex that matches this $intype.
+ ## If so, the associated name is the file we need.
+ ##
my $prefix = substr(lc($intype), 0, 2);
- if (exists $utf8::InPat{$prefix})
+ if (my $hashref = $utf8::InPat{$prefix})
{
print "inprefix = $prefix, In = $intype\n" if DEBUG;
- while (my ($pat, $name) = each %{$utf8::InPat{$prefix}})
+ while (my ($pat, $name) = each %{$hashref})
{
print "inprefix = $prefix, In = $intype, k = $pat\n" if DEBUG;
if ($intype =~ /^$pat$/i) {
$file = "unicore/In/$name.pl";
print "inprefix = $prefix, In = $intype, k = $pat, file = $file\n" if DEBUG;
+ keys %{$hashref}; ## reset the 'each' above
last GETFILE;
}
}