From b342e77e748bf7cae399ffbf26e9dc582ccbe9ae Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 30 Jun 2010 15:19:39 -0600 Subject: [PATCH 1/1] 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. --- lib/charnames.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 1.8.3.1