Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Re: (my?) problem with re-blessed references(?)

by djantzen (Priest)
on Dec 13, 2002 at 07:00 UTC ( #219522=note: print w/replies, xml ) Need Help??

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

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://219522]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2022-11-29 18:30 GMT
Find Nodes?
    Voting Booth?