in reply to OO Design Question with Hashes of Arrays

G'day ahackney,

Welcome to the monastery.

"... making the contents of the hash an array is a mystery to me."

A hash contains pairs of keys and values. While the contents of a hash could be considered as an array with an even number of elements, I'm guessing that's not really what you're driving at. Take a look at perlintro - Perl variable types for an overview and follow the links therein for more detailed discussion.

"I am trying to make the following hash an attribute of the above class."

Given the example data you've shown, I imagine you want to end up with something along these lines:

my $self = { ... aclsMissingFromMaster => { list1 => [1, 2, 3, 4], list2 => [5, 6, 7, 8], ... }, };

Take a look at Perl Data Structures Cook Book - HASHES OF ARRAYS to understand this data structure and how it can be created, accessed and manipulated.

You haven't provided sufficient information to advise whether a separate class for ACLs would be appropriate. If this is the only place you're handling ACLs, then maybe not; however, if you'll be working with ACLs in other classes (or as stand-alone objects), then it probably would be a good idea.

As you appear to be at the design (or, at least, very early development) stage, I'd recommend you consider Moose (or one of its relatives, e.g. Mouse, Moo) rather than coding your constructors from scratch and dealing with all the issues that arise from that course of action. The Moose DESCRIPTION starts off:

Moose is an extension of the Perl 5 object system.

The main goal of Moose is to make Perl 5 Object Oriented programming easier, more consistent, and less tedious. With Moose you can think more about what you want to do and less about the mechanics of OOP.

-- Ken