diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-06-23 10:14:43 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-06-23 10:14:43 +0000 |
commit | 075d4edd61a9648945541c8a76d8c03d4588400b (patch) | |
tree | 016036781878bc1809fe9dc6af234d420d401767 /lib/charnames.pm | |
parent | 60a1aa196c6751722bae1e1ee83a99d0d965146d (diff) | |
download | perl-075d4edd61a9648945541c8a76d8c03d4588400b.tar.gz |
Tels' patch to defer overloading of hex and oct,
to avoid magic leaking and smoke failures under
utf-8 locales
p4raw-id: //depot/perl@31450
Diffstat (limited to 'lib/charnames.pm')
-rw-r--r-- | lib/charnames.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/charnames.pm b/lib/charnames.pm index ef1472c31d..3b42738eb6 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -2,7 +2,7 @@ package charnames; use strict; use warnings; use File::Spec; -our $VERSION = '1.05'; +our $VERSION = '1.06'; use bytes (); # for $bytes::hint_bits @@ -167,7 +167,7 @@ sub charnames ## we know where it starts, so turn into number - ## the ordinal for the char. - $ord = hex substr($txt, $hexstart, $off[0] - $hexstart); + $ord = CORE::hex substr($txt, $hexstart, $off[0] - $hexstart); } if ($^H & $bytes::hint_bits) { # "use bytes" in effect? @@ -294,7 +294,7 @@ sub vianame my $arg = shift; - return chr hex $1 if $arg =~ /^U\+([0-9a-fA-F]+)$/; + return chr CORE::hex $1 if $arg =~ /^U\+([0-9a-fA-F]+)$/; return $vianame{$arg} if exists $vianame{$arg}; @@ -304,7 +304,7 @@ sub vianame if ($[ <= $pos) { my $posLF = rindex $txt, "\n", $pos; (my $code = substr $txt, $posLF + 1, 6) =~ tr/\t//d; - return $vianame{$arg} = hex $code; + return $vianame{$arg} = CORE::hex $code; # If $pos is at the 1st line, $posLF must be $[ - 1 (not found); # then $posLF + 1 equals to $[ (at the beginning of $txt). |