package Foo; use Moose; has a => (is => "rw"); sub BUILD { my($this, $args)=@_; $this->bar("whatever") unless defined $args->{bar}; }