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
Replies are listed 'Best First'.
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 making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2015-08-04 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (62 votes), past polls