From: John Peacock Date: Wed, 25 Apr 2001 17:30:26 +0000 (-0400) Subject: Re: [ID 20010422.002] 5.7.1 Breaks "use Module(version)" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4f14daa50ff79e763b90c905e323462060c08d7;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20010422.002] 5.7.1 Breaks "use Module(version)" Message-ID: <3AE741F2.B3217464@rowman.com> p4raw-id: //depot/perl@9842 --- diff --git a/lib/Math/BigInt.pm b/lib/Math/BigInt.pm index 839b746..745e1c6 100644 --- a/lib/Math/BigInt.pm +++ b/lib/Math/BigInt.pm @@ -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; diff --git a/t/lib/bigintpm.t b/t/lib/bigintpm.t index dac6f5f..6904c2d 100755 --- a/t/lib/bigintpm.t +++ b/t/lib/bigintpm.t @@ -69,7 +69,7 @@ while () { } { - use Math::BigInt ':constant'; + use Math::BigInt(0.02,':constant'); $test++; print "not "