From: Karl Williamson Date: Wed, 30 Jun 2010 21:19:39 +0000 (-0600) Subject: charnames: add CORE:: to hex() X-Git-Tag: v5.13.3~169 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/b342e77e748bf7cae399ffbf26e9dc582ccbe9ae?hp=0320cda07264be63db1ffb5e9512ee11cad682e8 charnames: add CORE:: to hex() Other programs do this; I don't know why just hex() needs to be protected from user override, but I'm just copying prior art. --- diff --git a/lib/charnames.pm b/lib/charnames.pm index 3ef3711..5cd9e40 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -438,7 +438,7 @@ sub alias (@) $inverse_user_aliases{sprintf("%04X", $value)} = $name; } elsif ($value =~ $hex_qr) { - my $decimal = hex $1; + my $decimal = CORE::hex $1; $user_numeric_aliases{$name} = $decimal; # Must convert to decimal and back to guarantee canonical form @@ -668,7 +668,7 @@ sub viacode } # checking the length first is slightly faster - if (length($hex) > 5 && hex($hex) > 0x10FFFF) { + if (length($hex) > 5 && CORE::hex($hex) > 0x10FFFF) { carp "Unicode characters only allocated up to U+10FFFF (you asked for U+$hex)"; return; }