From d2585a2dbcf7b50d5840bc2df3e213d3bf238062 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 4 Oct 2012 09:12:03 -0700 Subject: [PATCH] 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. --- dist/bignum/lib/bigint.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/bignum/lib/bigint.pm b/dist/bignum/lib/bigint.pm index 2d125b9..467a67d 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); } . -- 1.8.3.1