sub get_or_set { my $self = shift; if ( ! @_ && ! defined wantarray ) { die "accessor called in void context"; } $self->{stuff} = shift @_ if @_; return $self->{stuff}; }