sub accessor { my $self = shift; $self -> {key} = shift if @_; $self -> {key} } #### $obj -> accessor ("value"); #### $obj -> {key} = "value";