sub temperature { my ($self, $t) = @_; if (1 < @_) { $$self{temperature} = $t; } return $$self{temperature}; }
-> I do not see any technical reason for initial filling. Of course, sometimes you really want to initialize it because application logic.
In reply to Re: Creating consructor new with empty $self
by pajout
in thread Creating consructor new with empty $self
by vit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |