http://qs321.pair.com?node_id=608389


in reply to Method Chaining and Accessors

can't you just test for @_?
sub foo { my $self = shift; # oops, forgot this line before if (@_) { $self->{foo} = shift; return $self; } return $self->{foo}; }
updated to shift off self. thanks, Moron