When doing object-oriented programming, the first thing you should do is make a list of all of the types of objects that you have (or would like to have) in your finished program. Write down their methods and functions too. Arrange them and rearrange them while they are still just names on a piece of paper. It's well worth an hour of your time to come up with a conceptually sound set of object (classes) before you start coding. Another thing to remember about object-oriented programming is that there is no single "right" answer. Lots of different object models could solve your problem. And bear in mind that not everything needs to be an object (or an object's method).

In this particular case though, I think you said it yourself: "it does not make sense to call with a block object." That strongly suggests to me that it probably doesn't belong as part of a "block" object. Perhaps it should be part of a different kind of object (such as "map" for example).


In reply to Re: Mixing OO & non OO code in a module by MonkE
in thread Mixing OO & non OO code in a module by spatterson

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.