I'm realy confused. It appears that you want to be able to call a method with a value to save that value and then without a value to get the value. THen only if you don't call it with a value you want to call the actual method and store that value, and then calling it without a value gets that value. This seems realy confusing, at least the first part where you can send it the value you want it to save. Mostly you seem just to have attributes that sometimes you want to autoload from a method, so why not break them out a little? Getter and setter as methodname and then a seperate methods load_methodname or something like that? I think anyone looking at your code is going to be pretty confused unless already familary with your cacheing mechanism.


___________
Eric Hodges

In reply to Re: Memoizing Methods by eric256
in thread Memoizing Methods by bduggan

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.