I personally like my mutators/accessors made in such a way, that if you are setting a value, it will return the old value.
I do that sometimes if I think it would be useful. I usually return $self so $i->can->chain->methods->like->this - but I probably shouldn't start that discussion again :-)
In reply to Re^2: Single accessor/mutator idiom in Perl5, Perl6 and Python
by adrianh
in thread Single accessor/mutator idiom in Perl5, Perl6 and Python
by adrianh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |