Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by djantzen (Priest)
on Dec 13, 2002 at 07:00 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-28 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found