in reply to Instance data inheritance?

This would be composition, not inheritance in the OO sense, would it not? (Warning: Still trying to wrap my head around OO myself...)

Replies are listed 'Best First'.
Re^2: Instance data inheritance?
by blazar (Canon) on May 13, 2005 at 12:54 UTC
    Most probably, yes - I'm not really sure for I'm not familiar with the technical acceptation of composition as used here. In some sense, no. In fact I may well access such instance data through methods, and it would be fine for me to have
    package MyClass::Item; our @ISA=qw/MyClass/;
    But then again I'm not really sure whether it would be possible to access instance specific data this way and if so, which would be the "best way(TM)" to do so.

    Basically, in a real world example, I'd "simply" like to have the constructor (or some accessory method) of MyClass store some data into the instance objects, and I would like methods called on MyClass::Item objects to depend on that data.