package Person; use Moose; has 'label' => ( is => 'rw', isa => 'Str' ); has 'shift' => ( is => 'rw', isa => 'Str' ); #### then, in the script my $Person = Person->new; if($hash->{label}) { $Person->label( $hash->{label} ); } if($hash->{shift}) { $Person->shift( $hash->{shift} ); } #### autoderef is deprecated [...] Use of each/keys/pop/push/shift/splice/unshift/values on a reference is an experimental feature...