in reply to Re: Re: Re: Package Variables in Inheritance
in thread Package Variables in Inheritance
The ref $proto || $proto line is one which people disagree on the utility of. merlyn in particular is known for disliking it. My thoughts are milder, but I still dislike it. If you look in the thread starting here, I explain what it is supposed to do and why it doesn't really succeed.
Also you are defining $self and then returning it. There is no need to do that. Just return the result of bless.
And if you've made both of those changes, then there is no reason not to reduce a trivial new down to:
sub new { bless {}, shift; }
|
|---|