Thanks, that does help. I had something similar worked up for the constants, but missed the idea of having the function that accesses the data in the subclass, instead of in the parent. So I can work with that. One question, what's the value of the methods in the parent like find_fur_texture, vs. simply calling the method from the child directly? Also, one of the things that concerned me when reading the warnings about inheritance was the idea of calling the methods by name (ala, Monks::Data::get_texture) as opposed to something more abstract. But maybe I'm missing something? And finally I am definitely keeping the goal of keeping the public interface and the internals separate. :)

In regards to the last bit, one example would be a 2d hash with a bunch of compiled regular expressions that I'm using to parse the data that the module deals with. So something like this:

if (not defined $Monks::Parsers{ $self->{thing} }) { $self->{parser} = 'Generic'; }

And:

foreach my $key (keys %{ $Monks::Parsers{ $self->{parser} } }) { dostuff; }

Does that make sense?


In reply to Re^2: OO manner of accessing static variables in a subclass? by HipDeep
in thread OO manner of accessing static variables in a subclass? by HipDeep

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.