in reply to Method Chaining and Accessors
can't you just test for @_?
updated to shift off self. thanks, Moronsub foo { my $self = shift; # oops, forgot this line before if (@_) { $self->{foo} = shift; return $self; } return $self->{foo}; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Method Chaining and Accessors
by linenoise (Acolyte) on Apr 05, 2007 at 00:09 UTC | |
Re^2: Method Chaining and Accessors
by Moron (Curate) on Apr 05, 2007 at 12:49 UTC |
In Section
Seekers of Perl Wisdom