Skip to content

Instantly share code, notes, and snippets.

@gfx
Created March 3, 2010 06:56
Show Gist options
  • Save gfx/320395 to your computer and use it in GitHub Desktop.
Save gfx/320395 to your computer and use it in GitHub Desktop.
#!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