Re: [ID 20010422.002] 5.7.1 Breaks "use Module(version)"
authorJohn Peacock <jpeacock@rowman.com>
Wed, 25 Apr 2001 17:30:26 +0000 (13:30 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 25 Apr 2001 20:58:12 +0000 (20:58 +0000)
Message-ID: <3AE741F2.B3217464@rowman.com>

p4raw-id: //depot/perl@9842

lib/Math/BigInt.pm
t/lib/bigintpm.t

index 839b746..745e1c6 100644 (file)
@@ -1,5 +1,8 @@
 package Math::BigInt;
-$VERSION='0.01';
+require Exporter;
+@ISA = qw(Exporter);
+
+$VERSION='0.02';
 
 use overload
 '+'    =>      sub {new Math::BigInt &badd},
@@ -45,10 +48,16 @@ sub numify { 0 + "${$_[0]}" }       # Not needed, additional overhead
                                # comparing to direct compilation based on
                                # stringify
 sub import {
-  shift;
+  my $self = shift;
   return unless @_;
-  die "unknown import: @_" unless @_ == 1 and $_[0] eq ':constant';
-  overload::constant integer => sub {Math::BigInt->new(shift)};
+  for ( my $i; $i < @_ ; $i++ ) {
+         if ( $_[$i] eq ':constant' ) {
+                 overload::constant integer => sub {Math::BigInt->new(shift)};
+                 splice @_, $i, 1;
+                 last;
+         }
+  }
+  $self->SUPER::import(@_); 
 }
 
 $zero = 0;
index dac6f5f..6904c2d 100755 (executable)
@@ -69,7 +69,7 @@ while (<DATA>) {
 }
 
 {
-  use Math::BigInt ':constant';
+  use Math::BigInt(0.02,':constant');
 
   $test++;
   print "not "