http://www.perlmonks.org?node_id=219522


in reply to Re: (my?) problem with re-blessed references(?)
in thread (my?) problem with re-blessed references(?)

It would be better written $self->$func($value), where $func in this case is one of those ambiguous methods that is both accessor and mutator, like:

sub confoosing { my ($self, $arg) = @_; return $arg ? $self->{confoosing} = $arg : $self->confoosing; }

Your suggested rewrite of the constructor is generic enough to be entirely inheritable, obviating the need for QuotePlus::new, although this method kinda chaps my hide since I like to have a predetermined list of acceptable parameters for each constructor, even those in an inheritance chain. Doing it this way is convenient, except when it comes time for argument checking. I'm also still addicted to Java-style constructor chaining, although generally now I accomplish that by separating instantiation from initialization.

Cf. inheritance: constructors