One of the things I really like about Perl is that it leaves room for personal preference in terms of how to implement things. You can mix and match different programming paradigms as you see fit. You can go functional in domains where that makes most sense, OO where that makes sense, and so on.

That said there are times where 'personal preference' gets in the way of writing the best code. If you (generic) are opposed to OO in all circumstances due to personal preferences you are likely to write code in a way that is one or more of more complex, more buggy, and more difficult to extend and maintain than it would be otherwise. I have a sense here that you may be going in that direction here. Seems like to me that you are going through some awful complex gyrations to avoid OO syntax, but of course you are really using OO since tie just let's you do OO while making it look like you are doing some other kind of programming. This will give you a performance hit (though I'm not sure how much the tie-ing overhead really hits performance) which can be an issue in some types of computer games (I don't know about your particular case though).

--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."


In reply to Re^3: Using tie to return value of anonymous sub by DrWhy
in thread Using tie to return value of anonymous sub by dabreegster

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.