#!/usr/bin/perl { package TalkativeInt; use 5.010; use strict;use warnings; use base qw/Math::BigInt/; sub talk { say "I say ". $_[0]->value; } sub value { $_[0]->bstr(); } 1; } use 5.010; use strict;use warnings; my $p=TalkativeInt->new(7); $p->talk; #### #!/usr/bin/perl { package TalkativeInt; use 5.010; use Moose; extends 'Math::BigInt'; sub talk { say "I say ". $_[0]->value; } sub value { $_[0]->bstr(); } 1; } use 5.010; use strict;use warnings; my $p=TalkativeInt->new(7); $p->talk;