I understand that this is probably the main misunderstanding of any part of perl or Moose on my part, but I seem to be unable to return an ArrayRef from the default method:
has '_directories' => ( is => 'ro', isa => 'ArrayRef[Str]', lazy => 1, init_arg => undef, default => method {return File::Spec->splitdir($self->relativeDirectory)});
gives:
Attribute (_directories) does not pass the type constraint because: Validation failed for 'ArrayRef[Str]' with value 3
How to do it?
source share