I'm doing oo. And embracing the need for consistency accross interfaces. get_x() and set_x() are great consistent ways of naming methods to help maintain integrity of your encapsulation.

add_data(), get_data() and set_data() - where "data" is user, name, date, page, price, whatever.

I am trying to come up with a good general practice to name methods that return data prepped for HTML::Template. For example, a method that returns an array ref of users might be get_users_array() or simply get_users().

What would be a good genral way to distinguish methods that return data for HTML::Template?

I want to keep using this prepend, postpend, description- for methods accross all modules I make which are intended for possible use with HTML::Template. Any ideas? What would be good?


In reply to Consistent naming for methods that return HTML::Template prepped data? by leocharre

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.