in reply to Re: Method Chaining and Accessors
in thread Method Chaining and Accessors

Almost, but because the object arrives in $_[0] either way, you need to shift it out before testing @_, e.g. ...
sub foo { my $self = shift; @_ or return $self -> {foo}; $self ->{foo} = shift; $self; }

-M

Free your mind