Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Object::InsideOut and $obj->SUPER

by duckyd (Hermit)
on Nov 02, 2007 at 22:00 UTC ( [id://648732] : note . print w/replies, xml ) Need Help??


in reply to Object::InsideOut and $obj->SUPER (fixed)

Your child class must
use Object::InsideOut qw(class_insideout);
instead of
use base qw(class_insideout);
From the POD:
Sub-classes (child classes) inherit from base classes (parent classes) by telling Object::InsideOut what the parent class is: package My::Sub; { use Object::InsideOut qw(My::Parent); ... } <snip> Object::InsideOut acts as a replacement for the "base" pragma: It loads the parent module(s), calls their "->import()" methods, and sets up the sub-class's @ISA array. Therefore, you should not "use base .. +." yourself

Replies are listed 'Best First'.
Re^2: Object::InsideOut and $obj->SUPER (fixed)
by glide (Pilgrim) on Nov 05, 2007 at 10:08 UTC
    I thought that the use of
    use Object::InsideOut qw(My::Parent);
    was only for classes of the type Object::InsideOut. And I wanted a regular class (eventually hash based). But it works! Thanks.

    This is a drawback, imho, of using Object::InsideOut. For example, if you put a class in the cpan, based in the Object::InsideOut, the use of the class it's different from the expected.