X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/9663a7f582d8b5a489da7d8d8800291ca31c05a1..d2585a2dbcf7b50d5840bc2df3e213d3bf238062:/dist/bignum/lib/bigint.pm diff --git a/dist/bignum/lib/bigint.pm b/dist/bignum/lib/bigint.pm index 3120fdd..467a67d 100644 --- a/dist/bignum/lib/bigint.pm +++ b/dist/bignum/lib/bigint.pm @@ -1,7 +1,7 @@ package bigint; use 5.006; -$VERSION = '0.30'; +$VERSION = '0.31'; use Exporter; @ISA = qw( Exporter ); @EXPORT_OK = qw( PI e bpi bexp hex oct ); @@ -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); } .