Minor tweak:
That way, Parent->knob() is an accessor, while Parent->knob(undef) is a mutator that sets the $knob to undef. Slightly better:$knob = $_[0] if @_;
but that's only if there are invalid values you want to block.if (@_) { # check that $_[0] is allowed. $knob = $_[0]; }
In reply to Re^2: Static Variables in Perl
by Tanktalus
in thread Static Variables in Perl
by RollyGuy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |