From: Jarkko Hietaniemi Date: Tue, 10 Jul 2001 15:00:37 +0000 (+0000) Subject: Add compexcl(), casefold(), and casespec() interfaces; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b08cd201f6dd56800c3a806ca8bcd6503a4588a3;p=p5sagit%2Fp5-mst-13.2.git Add compexcl(), casefold(), and casespec() interfaces; and make all interfaces to return hash references instead of hashes. p4raw-id: //depot/perl@11260 --- diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index ff819cd..cc5d192 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -11,7 +11,9 @@ our @ISA = qw(Exporter); our @EXPORT_OK = qw(charinfo charblock charscript charblocks charscripts - charinrange); + charinrange + compexcl + casefold casespec); use Carp; @@ -22,7 +24,7 @@ Unicode::UCD - Unicode character database =head1 SYNOPSIS use Unicode::UCD 'charinfo'; - my %charinfo = charinfo($codepoint); + my $charinfo = charinfo($codepoint); use Unicode::UCD 'charblock'; my $charblock = charblock($codepoint); @@ -41,6 +43,9 @@ my $UNICODEFH; my $BLOCKSFH; my $SCRIPTSFH; my $VERSIONFH; +my $COMPEXCLFH; +my $CASEFOLDFH; +my $CASESPECFH; sub openunicode { my ($rfh, @path) = @_; @@ -63,10 +68,10 @@ sub openunicode { use Unicode::UCD 'charinfo'; - my %charinfo = charinfo(0x41); + my $charinfo = charinfo(0x41); -charinfo() returns a hash that has the following fields as defined -by the Unicode standard: +charinfo() returns a reference to a hash that has the following fields +as defined by the Unicode standard: key @@ -89,7 +94,7 @@ by the Unicode standard: block block the character belongs to (used in \p{In...}) script script the character belongs to -If no match is found, an empty hash is returned. +If no match is found, a reference to an empty hash is returned. The C property is the same as as returned by charinfo(). It is not defined in the Unicode Character Database proper (Chapter 4 of the @@ -98,9 +103,7 @@ of TUS3). Similarly for the C