Thanks for the reply, chromatic.

i think i was perhaps not clear enough about my definition of 'class data', as opposed to 'class defaults', which i believe your response addresses. my apologies.

some typical 'class data' for example might be:

# base class package AbstractMyClass; my $_Class_Count = 0; sub new { my $class = shift; my $this = bless( {}, $class ); ref($this) && $_Class_Count++; return $this; } package MyClass; @MyClass::ISA = ('AbstractMyClass'); sub new { my $class = shift; my $this = $class::SUPER->new( @_ ); # this class' init... return $this; }

if i were to use the code...

use AbstractMyClass; use MyClass; my $amc = new AbstractMyClass (); my $mc = new MyClass ();

...$AbstractMyClass::_Class_Count would be 2, whereas i would have really liked $AbstractMyClass::_Class_Count to be 1, and $MyClass::_Class_Count to be 1. Probably a bad example of the essence of my original question, but nevertheless illustrative of what i am terming 'class data'. thanks, matt aka d_i_r_t_y, since 'zero cool' was taken... ;-)


In reply to RE: Re: opinions on the best way to inherit class data by d_i_r_t_y
in thread opinions on the best way to inherit class data by d_i_r_t_y

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.