/snap/gh/640/usr/share/perl/5.38.2
NameSizeModeActions
App/-0755rm
Archive/-0755rm
Attribute/-0755rm
autodie/-0755rm
B/-0755rm
Carp/-0755rm
Class/-0755rm
Compress/-0755rm
Config/-0755rm
CPAN/-0755rm
DBM_Filter/-0755rm
Devel/-0755rm
Digest/-0755rm
Encode/-0755rm
encoding/-0755rm
Exporter/-0755rm
ExtUtils/-0755rm
File/-0755rm
Filter/-0755rm
Getopt/-0755rm
HTTP/-0755rm
I18N/-0755rm
IO/-0755rm
IPC/-0755rm
JSON/-0755rm
Locale/-0755rm
Math/-0755rm
Memoize/-0755rm
Module/-0755rm
Net/-0755rm
overload/-0755rm
Params/-0755rm
Parse/-0755rm
Perl/-0755rm
PerlIO/-0755rm
Pod/-0755rm
pod/-0755rm
Search/-0755rm
TAP/-0755rm
Term/-0755rm
Test/-0755rm
Test2/-0755rm
Text/-0755rm
Thread/-0755rm
Tie/-0755rm
Time/-0755rm
Unicode/-0755rm
unicore/-0755rm
User/-0755rm
version/-0755rm
warnings/-0755rm
AnyDBM_File.pm26180644editdlrm
autodie.pm124360644editdlrm
AutoLoader.pm157970644editdlrm
AutoSplit.pm196370644editdlrm
autouse.pm42380644editdlrm
base.pm109610644editdlrm
Benchmark.pm310230644editdlrm
bigfloat.pm219680644editdlrm
bigint.pm232470644editdlrm
bignum.pm282170644editdlrm
bigrat.pm211340644editdlrm
blib.pm20620644editdlrm
builtin.pm103920644editdlrm
bytes.pm37820644editdlrm
bytes_heavy.pl7580644editdlrm
Carp.pm359940644editdlrm
charnames.pm210490644editdlrm
constant.pm147240644editdlrm
CORE.pod31880644editdlrm
CPAN.pm1479710644editdlrm
DB.pm189220644editdlrm
DBM_Filter.pm143850644editdlrm
deprecate.pm50360644editdlrm
diagnostics.pm193340644editdlrm
Digest.pm112250644editdlrm
DirHandle.pm20850644editdlrm
Dumpvalue.pm176680644editdlrm
dumpvar.pl155550644editdlrm
English.pm47610644editdlrm
Env.pm55690644editdlrm
experimental.pm89300644editdlrm
Exporter.pm192120644editdlrm
Fatal.pm592360644editdlrm
feature.pm545970644editdlrm
fields.pm94750644editdlrm
FileCache.pm55490644editdlrm
FileHandle.pm68050644editdlrm
filetest.pm40030644editdlrm
FindBin.pm46160644editdlrm
if.pm36310644editdlrm
integer.pm32540644editdlrm
Internals.pod25750644editdlrm
less.pm32040644editdlrm
locale.pm48850644editdlrm
Memoize.pm325860644editdlrm
meta_notation.pm20690644editdlrm
NEXT.pm189820644editdlrm
ok.pm9670644editdlrm
open.pm84980644editdlrm
overload.pm547230644editdlrm
overloading.pm18080644editdlrm
parent.pm27020644editdlrm
perl5db.pl3175700644editdlrm
perlfaq.pm770644editdlrm
PerlIO.pm142590644editdlrm
Safe.pm253520644editdlrm
SelectSaver.pm10760644editdlrm
SelfLoader.pm176860644editdlrm
sigtrap.pm87330644editdlrm
sort.pm29920644editdlrm
stable.pm46570644editdlrm
strict.pm47830644editdlrm
subs.pm9450644editdlrm
Symbol.pm49050644editdlrm
Test.pm300420644editdlrm
Test2.pm63930644editdlrm
Thread.pm82890644editdlrm
UNIVERSAL.pm68340644editdlrm
utf8.pm108880644editdlrm
vars.pm24580644editdlrm
version.pm19760644editdlrm
version.pod98320644editdlrm
vmsish.pm43130644editdlrm
warnings.pm570690644editdlrm
XSLoader.pm113990644editdlrm
_charnames.pm356790644editdlrm
Edit: /snap/gh/640/usr/share/perl/5.38.2/charnames.pm (21049B)
package charnames; use strict; use warnings; our $VERSION = '1.50'; use unicore::Name; # mktables-generated algorithmically-defined names use _charnames (); # The submodule for this where most of the work gets done use bytes (); # for $bytes::hint_bits use re "/aa"; # Everything in here should be ASCII # Translate between Unicode character names and their code points. # This is a wrapper around the submodule C<_charnames>. This design allows # C<_charnames> to be autoloaded to enable use of \N{...}, but requires this # module to be explicitly requested for the functions API. $Carp::Internal{ (__PACKAGE__) } = 1; sub import { shift; ## ignore class name _charnames->import(@_); } # Cache of already looked-up values. This is set to only contain # official values, and user aliases can't override them, so scoping is # not an issue. my %viacode; sub viacode { return _charnames::viacode(@_); } sub vianame { if (@_ != 1) { _charnames::carp "charnames::vianame() expects one name argument"; return () } # Looks up the character name and returns its ordinal if # found, undef otherwise. my $arg = shift; return () unless length $arg; if ($arg =~ /^U\+([0-9a-fA-F]+)$/) { # khw claims that this is poor interface design. The function should # return either a an ord or a chr for all inputs; not be bipolar. But # can't change it because of backward compatibility. New code can use # string_vianame() instead. my $ord = CORE::hex $1; return chr utf8::unicode_to_native($ord) if $ord <= 255 || ! ((caller 0)[8] & $bytes::hint_bits); _charnames::carp _charnames::not_legal_use_bytes_msg($arg, chr $ord); return; } # The first 1 arg means wants an ord returned; the second that we are in # runtime, and this is the first level routine called from the user return _charnames::lookup_name($arg, 1, 1); } # vianame sub string_vianame { # Looks up the character name and returns its string representation if # found, undef otherwise. if (@_ != 1) { _charnames::carp "charnames::string_vianame() expects one name argument"; return; } my $arg = shift; return () unless length $arg; if ($arg =~ /^U\+([0-9a-fA-F]+)$/) { my $ord = CORE::hex $1; return chr utf8::unicode_to_native($ord) if $ord <= 255 || ! ((caller 0)[8] & $bytes::hint_bits); _charnames::carp _charnames::not_legal_use_bytes_msg($arg, chr $ord); return; } # The 0 arg means wants a string returned; the 1 arg means that we are in # runtime, and this is the first level routine called from the user return _charnames::lookup_name($arg, 0, 1); } # string_vianame 1; __END__ =encoding utf8 =head1 NAME charnames - access to Unicode character names and named character sequences; also define character names =head1 SYNOPSIS use charnames ':full'; print "\N{GREEK SMALL LETTER SIGMA} is called sigma.\n"; print "\N{LATIN CAPITAL LETTER E WITH VERTICAL LINE BELOW}", " is an officially named sequence of two Unicode characters\n"; use charnames ':loose'; print "\N{Greek small-letter sigma}", "can be used to ignore case, underscores, most blanks," "and when you aren't sure if the official name has hyphens\n"; use charnames ':short'; print "\N{greek:Sigma} is an upper-case sigma.\n"; use charnames qw(cyrillic greek); print "\N{sigma} is Greek sigma, and \N{be} is Cyrillic b.\n"; use utf8; use charnames ":full", ":alias" => { e_ACUTE => "LATIN SMALL LETTER E WITH ACUTE", mychar => 0xE8000, # Private use area "自転車に乗る人" => "BICYCLIST" }; print "\N{e_ACUTE} is a small letter e with an acute.\n"; print "\N{mychar} allows me to name private use characters.\n"; print "And I can create synonyms in other languages,", " such as \N{自転車に乗る人} for "BICYCLIST (U+1F6B4)\n"; use charnames (); print charnames::viacode(0x1234); # prints "ETHIOPIC SYLLABLE SEE" printf "%04X", charnames::vianame("GOTHIC LETTER AHSA"); # prints # "10330" print charnames::vianame("LATIN CAPITAL LETTER A"); # prints 65 on # ASCII platforms; # 193 on EBCDIC print charnames::string_vianame("LATIN CAPITAL LETTER A"); # prints "A" =head1 DESCRIPTION Pragma C is used to gain access to the names of the Unicode characters and named character sequences, and to allow you to define your own character and character sequence names. All forms of the pragma enable use of the following 3 functions: =over =item * L)> for run-time lookup of a either a character name or a named character sequence, returning its string representation =item * L)> for run-time lookup of a character name (but not a named character sequence) to get its ordinal value (code point) =item * L)> for run-time lookup of a code point to get its Unicode name. =back Starting in Perl v5.16, any occurrence of C<\N{I}> sequences in a double-quotish string automatically loads this module with arguments C<:full> and C<:short> (described below) if it hasn't already been loaded with different arguments, in order to compile the named Unicode character into position in the string. Prior to v5.16, an explicit S> was required to enable this usage. (However, prior to v5.16, the form C> did not enable C<\N{I}>.) Note that C<\N{U+I<...>}>, where the I<...> is a hexadecimal number, also inserts a character into a string. The character it inserts is the one whose Unicode code point (ordinal value) is equal to the number. For example, C<"\N{U+263a}"> is the Unicode (white background, black foreground) smiley face equivalent to C<"\N{WHITE SMILING FACE}">. Also note, C<\N{I<...>}> can mean a regex quantifier instead of a character name, when the I<...> is a number (or comma separated pair of numbers (see L), and is not related to this pragma. The C pragma supports arguments C<:full>, C<:loose>, C<:short>, script names and L. If C<:full> is present, for expansion of C<\N{I}>, the string I is first looked up in the list of standard Unicode character names. C<:loose> is a variant of C<:full> which allows I to be less precisely specified. Details are in L. If C<:short> is present, and I has the form C:I>, then I is looked up as a letter in script I