Hi ahackney,
While, I advise that you take vantage of the wisdom and words of kcott, I will say it's not bad to 'eat' on the boilerplate of perl OO intrinsic design.
..I am trying to make the following hash an attribute of the above class...
You could write subroutine, to 'set' and 'get', the value of the hash attribute like this:

{ package My::Sys; sub new { my $class = shift; my $self = { coreID => 0, isBpMaskError => 0, isVrrpErrors => 0, isSymPriorityErrors => 0, isSslProfileErrors => 0, isGlobalPortErrors => 0, isVipsinVipGroupsErrors => 0, isVipGroupErrors => 0, isSnatIpErrors => 0, isCodeVersionErrors => 0, aclsMissingFromMaster => {}, }; bless $self, $class; return $self; } sub set_acls{ my $self = shift; my $cot = 0; $self->{aclsMissingFromMaster}{"list ".++$cot} = $_ for @_; } sub get_acls{ my $self = shift; return $self->{aclsMissingFromMaster}; } } use Data::Dumper; my $sys = My::Sys->new(); my @arr = ([1..4],[5..8],); # set the attribute $sys->set_acls(@arr); { local $Data::Dumper::Sortkeys = 1; # get your values here print Dumper $sys->get_acls(); }
..you get...
$VAR1 = { 'list 1' => [ 1, 2, 3, 4 ], 'list 2' => [ 5, 6, 7, 8 ] };
Just an example for you to see...
You might want to check some other documentation like perlobj, perlootut.


In reply to Re: OO Design Question with Hashes of Arrays by Anonymous Monk
in thread OO Design Question with Hashes of Arrays by ahackney

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.