diff options
author | John Peacock <jpeacock@rowman.com> | 2001-04-25 13:30:26 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-25 20:58:12 +0000 |
commit | b4f14daa50ff79e763b90c905e323462060c08d7 (patch) | |
tree | 4373e9ac09a8d2a07c0670b713901be074cabbf7 /lib/Math/BigInt.pm | |
parent | a086fe0347007cb1cc3d693b9c1619faed0ba3a8 (diff) | |
download | perl-b4f14daa50ff79e763b90c905e323462060c08d7.tar.gz |
Re: [ID 20010422.002] 5.7.1 Breaks "use Module(version)"
Message-ID: <3AE741F2.B3217464@rowman.com>
p4raw-id: //depot/perl@9842
Diffstat (limited to 'lib/Math/BigInt.pm')
-rw-r--r-- | lib/Math/BigInt.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/Math/BigInt.pm b/lib/Math/BigInt.pm index 839b746c24..745e1c6479 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; |