Adamba has asked for the wisdom of the Perl Monks concerning the following question:

Hey! I'm trying to create a member in Moose that is a ArrayRef of an HashRef.
It should be something like:</p

[ { key => value, key => value, }, ], [ { key => value, key => value, }, ]
but I have no clue how to do it on Moose... any suggestions?

Replies are listed 'Best First'.
Re: ArrayRef of HashRef
by zwon (Abbot) on Apr 01, 2012 at 08:40 UTC
    That's quite simple:
    has attr => (is => 'rw', isa => 'ArrayRef[HashRef]');

      While zwon's ArrayRef[HashRef] does indeed match the question, it doesn't match the sample data, which isn't an ArrayRef of HashRefs. It looks more like an array of array-refs of hash-refs.

      The question needs to be clarified. Which question do you really mean?

      Update: fixed typo