For object attribute accessor methods like this, I prefer this idiom:
sub value { my $self = shift; return $self->{value} if not @_; $self->{value} = shift; }
Thus, you can say $x = $o->value, or $o->value(5);.
--
[ e d @ h a l l e y . c c ]
In reply to Re: Perl Naming Conventions
by halley
in thread Perl Naming Conventions
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |