Just for confirmation, I see the same test results when I run your code.

However, taking a look at Object::InsideOut's documentation I noticed this:

Object::InsideOut implements inside-out objects as anonymous scalar references that are blessed into a class with the scalar containing the ID for the object ...

The underlined part implies that an object must access its body (the scalar ref) to get its id. This is something a real inside-out object never does. The salient point about the inside-out model is that nothing is stored in the object itself, so that the body is never accessed. This, and only this, gives inside-out classes the indepencence from object implementation that makes inheritance "just work", the way it does in dedicated OO languages.

In other words, Object::InsideOut doesn't give you true inside-out objects. You're probably better off if you base your class on one of the other implementations of inside-out classes on CPAN (Class::InsideOut or Class::Std), or implement it directly.

Anno

Update:I erroneously accused Class::InsideOut of not giving you "true inside-out objects". Corrected to say Object::InsideOut. Class::InsideOut does produce true inside-out objects. Apologies to those involved, and thanks to shmem who caught the error.

Update: Made links of some references to classes


In reply to Re: Difficulty with Object::InsideOut by Anno
in thread Difficulty with Object::InsideOut by herveus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.