package Foo; use Moose; has 'number' => ( is => 'rw', isa => 'Num', ); sub BUILD { my ( $self, $args ) = @_; $self->number( $args->{ 'foo' } * 42 ); }