$^H{bigint} = 1; # we are in effect
+ my ($hex,$oct);
# for newer Perls always override hex() and oct() with a lexical version:
if ($] > 5.009004)
{
- no warnings 'redefine';
- *CORE::GLOBAL::oct = \&_oct;
- *CORE::GLOBAL::hex = \&_hex;
+ $oct = \&_oct;
+ $hex = \&_hex;
}
# some defaults
my $lib = ''; my $lib_kind = 'try';
elsif ($_[$i] eq 'hex')
{
splice @a, $j, 1; $j --;
- no warnings 'redefine';
- *CORE::GLOBAL::hex = \&_hex_global;
+ $hex = \&_hex_global;
}
elsif ($_[$i] eq 'oct')
{
splice @a, $j, 1; $j --;
- no warnings 'redefine';
- *CORE::GLOBAL::oct = \&_oct_global;
+ $oct = \&_oct_global;
}
else { die "unknown option $_[$i]"; }
}
{
$self->export_to_level(1,$self,@a); # export inf and NaN
}
+ {
+ no warnings 'redefine';
+ *CORE::GLOBAL::oct = $oct if $oct;
+ *CORE::GLOBAL::hex = $hex if $hex;
+ }
}
sub inf () { Math::BigInt->binf(); }
$^H{bignum} = 1; # we are in effect
+ my ($hex,$oct);
+
# for newer Perls override hex() and oct() with a lexical version:
if ($] > 5.009003)
{
- no warnings 'redefine';
- *CORE::GLOBAL::oct = \&_oct;
- *CORE::GLOBAL::hex = \&_hex;
+ $hex = \&_hex;
+ $oct = \&_oct;
}
# some defaults
elsif ($_[$i] eq 'hex')
{
splice @a, $j, 1; $j --;
- no warnings 'redefine';
- # override with a global version
- *CORE::GLOBAL::hex = \&bigint::_hex_global;
+ $hex = \&bigint::_hex_global;
}
elsif ($_[$i] eq 'oct')
{
splice @a, $j, 1; $j --;
- no warnings 'redefine';
- # override with a global version
- *CORE::GLOBAL::oct = \&bigint::_oct_global;
+ $oct = \&bigint::_oct_global;
}
else { die "unknown option $_[$i]"; }
}
{
$self->export_to_level(1,$self,@a); # export inf and NaN
}
+ {
+ no warnings 'redefine';
+ *CORE::GLOBAL::oct = $oct if $oct;
+ *CORE::GLOBAL::hex = $hex if $hex;
+ }
}
1;
$^H{bigrat} = 1; # we are in effect
+ my ($hex,$oct);
# for newer Perls always override hex() and oct() with a lexical version:
if ($] > 5.009004)
{
- no warnings 'redefine';
- *CORE::GLOBAL::oct = \&_oct;
- *CORE::GLOBAL::hex = \&_hex;
+ $oct = \&_oct;
+ $hex = \&_hex;
}
# some defaults
my $lib = ''; my $lib_kind = 'try'; my $upgrade = 'Math::BigFloat';
elsif ($_[$i] eq 'hex')
{
splice @a, $j, 1; $j --;
- no warnings 'redefine';
- *CORE::GLOBAL::hex = \&bigint::_hex_global;
+ $hex = \&bigint::_hex_global;
}
elsif ($_[$i] eq 'oct')
{
splice @a, $j, 1; $j --;
- no warnings 'redefine';
- *CORE::GLOBAL::oct = \&bigint::_oct_global;
+ $oct = \&bigint::_oct_global;
}
else
{
{
$self->export_to_level(1,$self,@a); # export inf and NaN
}
+ {
+ no warnings 'redefine';
+ *CORE::GLOBAL::oct = $oct if $oct;
+ *CORE::GLOBAL::hex = $hex if $hex;
+ }
}
1;
use strict;
use warnings;
use File::Spec;
-our $VERSION = '1.05';
+our $VERSION = '1.06';
use bytes (); # for $bytes::hint_bits
## 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?
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};
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).
$utf8::hint_bits = 0x00800000;
-our $VERSION = '1.06';
+our $VERSION = '1.07';
sub import {
$^H |= $utf8::hint_bits;
$list = join '',
map { $_->[1] }
sort { $a->[0] <=> $b->[0] }
- map { /^([0-9a-fA-F]+)/; [ hex($1), $_ ] }
+ map { /^([0-9a-fA-F]+)/; [ CORE::hex($1), $_ ] }
grep { /^([0-9a-fA-F]+)/ and not $seen{$1}++ } @tmp; # XXX doesn't do ranges right
}
if ($minbits != 1 && $minbits < 32) { # not binary property
my $top = 0;
while ($list =~ /^([0-9a-fA-F]+)(?:[\t]([0-9a-fA-F]+)?)(?:[ \t]([0-9a-fA-F]+))?/mg) {
- my $min = hex $1;
- my $max = defined $2 ? hex $2 : $min;
- my $val = defined $3 ? hex $3 : 0;
+ my $min = CORE::hex $1;
+ my $max = defined $2 ? CORE::hex $2 : $min;
+ my $val = defined $3 ? CORE::hex $3 : 0;
$val += $max - $min if defined $3;
$top = $val if $val > $top;
}