Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: classic OO Perl: naming instance variables

by j3 (Friar)
on Apr 11, 2007 at 16:49 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://609424]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-09-09 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.