Ok. Ive just recieved an explaination of this matter from the kind folks at p5p.

Turns out that the behaviour you have stumbled upon is an undocumented feature to prevent horrible horrible things from happening with self tied objects. Basically before any tie related operation occurs the thing it affects has its Magic bits temporarily suspended to prevent infinite recursion.

The reason why it doesnt _seem_ to happen on a FETCH/STORE but does on CLEAR is because FETCH/STORE affects an element (and that element does indeed have its magic bit cleared) wheras CLEAR affects the whole object. This also explains the behaviour of the other Tie types. Where the autocalled method affects the overall tie it will seem as though the object isn't tied for the duration of that method.

BTW, why do you need this behaviour? I'm interested in the core problem you are facing. For instance why isn't the access to $self sufficient for your needs?

--- demerphq
my friends call me, usually because I'm late....


In reply to Re: Where's my tie ? by demerphq
in thread Where's my tie ? by philou

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.