in reply to Re^4: Object as Moose Object attribute
in thread Object as Moose Object attribute

That depends a bit on what your XML looks like - XMLin will usually return a hashref, but there is some XML that will cause it to return an arrayref. So if you wanted to play it safe you could say isa => 'HashRef | ArrayRef', or if you know your XML will always look a certain way and so XMLin will always return a hashref, just say isa => 'HashRef', which should make the rest of your code easier because it doesn't have to check every time if it's a hashref or arrayref. Ref is a superset that includes a whole lot more than hashrefs and arrayrefs, so it's probably too general. For all the details see Moose::Manual::Types. By the way, XML::Simple is not really recommended for new code, see for example this thread.

(Update: Your Mother already replied as I was typing, so yeah :-) )

Replies are listed 'Best First'.
Re^6: Object as Moose Object attribute
by Your Mother (Archbishop) on Nov 02, 2015 at 20:52 UTC

    As our answers are essentially identical, I heartily endorse yours! Sychronicity intentsifies…

Re^6: Object as Moose Object attribute
by An4ximandre (Novice) on Nov 02, 2015 at 21:00 UTC

    Thanks a lot, both of you !