Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2020-02-18 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (79 votes). Check out past polls.

    Notices?