diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-12-18 20:45:14 -0700 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-12-20 22:02:42 -0700 |
commit | fbb93542d6662666a88828fb4c15803f8ba377f0 (patch) | |
tree | 300d9b114ad07a3281c6575d2abb02b7645389b7 /pod/perlrebackslash.pod | |
parent | f8988b416c244747b17eb3004ac6f8bbcf366e7a (diff) | |
download | perl-fbb93542d6662666a88828fb4c15803f8ba377f0.tar.gz |
Autoload charnames for \N{name}
This autoloads charnames.pm when needed. It uses the :full and :short
options. :loose is not used because of its relative unfamiliarity in
the Perl community, and is slower. (If someone later added a typical
"use charnames qw(:full)", things that previously matched under :loose
would start to fail, causing confustion. If :loose does become more
common, we can change this in the future to use it; the converse isn't
true.)
The callable functions in the module are not automatically loaded. To
access them, an explicity "use charnames" must be provided.
Thanks to Tony Cook for doing a code inspection and finding a missing
SPAGAIN.
Diffstat (limited to 'pod/perlrebackslash.pod')
-rw-r--r-- | pod/perlrebackslash.pod | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/pod/perlrebackslash.pod b/pod/perlrebackslash.pod index df646d5465..f9b963c96c 100644 --- a/pod/perlrebackslash.pod +++ b/pod/perlrebackslash.pod @@ -173,8 +173,7 @@ C<\N{}> construct to specify a character by either of these values. Certain sequences of characters also have names. To specify by name, the name of the character or character sequence goes -between the curly braces. In this case, you have to C<use charnames> to -load the Unicode names of the characters; otherwise Perl will complain. +between the curly braces. To specify a character by Unicode code point, use the form C<\N{U+I<code point>}>, where I<code point> is a number in hexadecimal that gives the @@ -201,7 +200,6 @@ meaning by the regex engine, and will match "as is". =head4 Example - use charnames ':full'; # Loads the Unicode names. $str =~ /\N{THAI CHARACTER SO SO}/; # Matches the Thai SO SO character use charnames 'Cyrillic'; # Loads Cyrillic names. |