Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 romping around the Monastery: (4)
As of 2014-09-18 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (126 votes), past polls