Math::BigInt::FastCalc doesn't need to override methods in a BEGIN block.
authorNicholas Clark <nick@ccl4.org>
Thu, 28 Oct 2010 18:10:17 +0000 (19:10 +0100)
committerNicholas Clark <nick@ccl4.org>
Fri, 29 Oct 2010 13:42:41 +0000 (14:42 +0100)
The BEGIN context of the code C<use>ing it will be early enough for the
subroutine assignments to take full effect.

dist/Math-BigInt-FastCalc/FastCalc.pm

index bc7ab94..f044132 100644 (file)
@@ -16,11 +16,9 @@ $VERSION = '0.24';
 # announce that we are compatible with MBI v1.70 and up
 sub api_version () { 1; }
  
-BEGIN
-  {
-  # use Calc to override the methods that we do not provide in XS
+# use Calc to override the methods that we do not provide in XS
 
-  for my $method (qw/
+for my $method (qw/
     str
     add sub mul div
     rsft lsft
@@ -39,7 +37,6 @@ BEGIN
     }
 
   ($BASE_LEN, $BASE) = Math::BigInt::Calc::_base_len();
-  }
 
 require XSLoader;
 XSLoader::load(__PACKAGE__, $VERSION, $BASE_LEN, $BASE);