I would strongly second tilly's recommendation, and not merely so as to avoid confusion.

There are also bugs in some versions of perl that cause objects that are blessed and tied to the same class not to behave correctly. In some versions destructors are not called consistently on such objects; in others, operator overloading of tied-and-blessed objects is broken.

The problems seem to vary both from version to version, and from platform to platform. So even if your particular usage works on your particular version of perl on your particular machine, it's unlikely to be temporally or spatially portable.

I ran into this problem when I was writing Regexp::Common, and quickly decided that the three extra lines needed to implement separate tieable and blessable classes were a very small price to pay to retain my sanity. ;-)


In reply to Re: Re (tilly) 1: Combined tied-array / object problem by TheDamian
in thread Combined tied-array / object problem by Masem

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.