diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-09-20 20:22:45 +0300 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-09-26 17:01:11 +0000 |
commit | 2d92f8a00cb1e1f5a01e5a2057563ce78851c792 (patch) | |
tree | 3c3ad27f9982f8b58776e9b69544140181495635 /lib/utf8_heavy.pl | |
parent | 6d5637c3050c14fb5c11ec5a05db33dce9e4a7a8 (diff) | |
download | perl-2d92f8a00cb1e1f5a01e5a2057563ce78851c792.tar.gz |
perl #17453
Message-ID: <20020920142245.GG280265@lyta.hut.fi>
p4raw-id: //depot/perl@17933
Diffstat (limited to 'lib/utf8_heavy.pl')
-rw-r--r-- | lib/utf8_heavy.pl | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index 1839d2144f..50b2d6d366 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -28,7 +28,7 @@ sub SWASHNEW { ## ranges. ## ## To make the parsing of $type clear, this code takes the a rather - ## unorthadox approach of last'ing out of the block once we have the + ## unorthodox approach of last'ing out of the block once we have the ## info we need. Were this to be a subroutine, the 'last' would just ## be a 'return'. ## @@ -50,7 +50,9 @@ sub SWASHNEW { ## ## 'Block=' is replaced by 'In'. ## - $type =~ s/^Is(?:\s+|[-_])?//i + my $wasIs; + + ($wasIs = $type =~ s/^Is(?:\s+|[-_])?//i) or $type =~ s/^Category\s*=\s*//i or @@ -85,20 +87,17 @@ sub SWASHNEW { ## It could be a user-defined property. ## - if ($type =~ /^I[ns](\w+)$/) { - my @caller = caller(1); - - if (defined $caller[0]) { - my $prop = $caller[0] . "::" . $type; - - if (exists &{$prop}) { - no strict 'refs'; + my $caller = caller(1); - $list = &{$prop}; - last GETFILE; - } - } - } + if (defined $caller && $type =~ /^(?:\w+)$/) { + my $prop = $caller . "::" . ( $wasIs ? "Is" : "" ) . $type; + if (exists &{$prop}) { + no strict 'refs'; + + $list = &{$prop}; + last GETFILE; + } + } ## ## Last attempt -- see if it's a "To" name (e.g. "ToLower") |