Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 perusing the Monastery: (5)
As of 2014-12-28 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (179 votes), past polls