Message-ID: <
3AE741F2.B3217464@rowman.com>
p4raw-id: //depot/perl@9842
package Math::BigInt;
-$VERSION='0.01';
+require Exporter;
+@ISA = qw(Exporter);
+
+$VERSION='0.02';
use overload
'+' => sub {new Math::BigInt &badd},
# 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;
}
{
- use Math::BigInt ':constant';
+ use Math::BigInt(0.02,':constant');
$test++;
print "not "