Created
March 3, 2010 06:56
-
-
Save gfx/320395 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl -w | |
use Any::Moose; | |
use Any::Moose '::Util::TypeConstraints'; | |
use Math::BigInt; | |
subtype 'BigInt', as 'Math::BigInt'; | |
coerce 'BigInt', | |
from 'Int', via { Math::BigInt->new($_) }; | |
has value => ( | |
is => "rw", | |
isa => "BigInt", | |
coerce => 1, | |
); | |
warn __PACKAGE__->new(value => "1" . ("0"x100)); | |
warn __PACKAGE__->new(value => 10e100); | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment