summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-10-04 09:12:03 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-10-04 09:37:59 -0700
commitd2585a2dbcf7b50d5840bc2df3e213d3bf238062 (patch)
tree702b66410527e27f724fe9158773e3c4d6018558 /dist
parent2666a4be6e28d06aa4c6e3b3ab64f9b54593b51f (diff)
downloadperl-d2585a2dbcf7b50d5840bc2df3e213d3bf238062.tar.gz
bigint: Fix new oct override for older Math::BigInt
Older versions of Math::BigInt required the input to from_oct to begin with a 0.
Diffstat (limited to 'dist')
-rw-r--r--dist/bignum/lib/bigint.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/dist/bignum/lib/bigint.pm b/dist/bignum/lib/bigint.pm
index 2d125b9e3b..467a67d167 100644
--- a/dist/bignum/lib/bigint.pm
+++ b/dist/bignum/lib/bigint.pm
@@ -137,7 +137,7 @@ sub oct(' . $proto . ')' . <<'.';
{
my $i = @_ ? $_[0] : $_;
# oct() should never fall back to decimal
- return Math::BigInt->from_oct($i) if $i =~ /^(?:0[0-9]|[1-9])/;
+ return Math::BigInt->from_oct($i) if $i =~ s/^(?=0[0-9]|[1-9])/0/;
Math::BigInt->new($i);
}
.
@@ -166,7 +166,7 @@ sub _oct(_)
unless $$hh{bigint}||$$hh{bignum}||$$hh{bigrat};
my $i = $_[0];
# oct() should never fall back to decimal
- return Math::BigInt->from_oct($i) if $i =~ /^(?:0[0-9]|[1-9])/;
+ return Math::BigInt->from_oct($i) if $i =~ s/^(?=0[0-9]|[1-9])/0/;
Math::BigInt->new($i);
}
.