Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: inheritance: constructors

by rjray (Chaplain)
on Jun 25, 2002 at 10:05 UTC ( #177052=note: print w/ replies, xml ) Need Help??


in reply to Re: inheritance: constructors
in thread inheritance: constructors

In Noun::new(), you need to either defer blessing or re-bless after you've invoked SUPER::new(). Unless you do, Noun::new will return instances of Word.

This is not correct. The original author correctly designed the parent-class new constructor to bless based on the class it was called from-- in the case of the example above, Word::new will in fact bless the new object into the Noun class, because that is the value of $classname at that point.

--rjray


Comment on Re: Re: inheritance: constructors

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (12)
As of 2015-07-06 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (81 votes), past polls