sub foo { my ($this, $arg) = @_; $this->{foo} = $arg if @_>1; return $this->{foo}; }