Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: classic OO Perl: naming instance variables

by j3 (Friar)
on Apr 11, 2007 at 16:49 UTC ( #609424=note: print w/ replies, xml ) Need Help??


in reply to Re: classic OO Perl: naming instance variables
in thread classic OO Perl: naming instance variables

In cases where I need to re-bless a hashref from a parent class constructor, {snip}

Just curious, why would you ever need to re-bless a hashref? I've always figured you bless once, using the 2-arg form, in your base class. Inherited classes use $class->SUPER::new(...) to reach back and have the parent do it.


Comment on Re^2: classic OO Perl: naming instance variables
Re^3: classic OO Perl: naming instance variables
by friedo (Prior) on Apr 11, 2007 at 17:19 UTC
    You're right, you shouldn't normally have to re-bless; I misspoke. On rare occasions, however, I have had to write a class derived from one that used the incorrect form of bless, in which case re-blessing was required.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-07-06 15:46 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 (77 votes), past polls