pages:
- Page:
URL: http://www.perlmonks.org/
- Page:
URL: http://www.perl.org/
####
package Page;
our $VERSION=0.01;
use Moose;
has 'URL' => (is => 'ro', isa => 'Str',required => 1);
__PACKAGE__->meta->make_immutable;
1;
####
package PagesGenerator;
our $VERSION=0.01;
use Moose;
with 'MooseX::SimpleConfig';
use Page;
has 'pages'=>(
is=>'rw',
isa=>'ArrayRef[Page]',
default => sub { [ ] },
);
__PACKAGE__->meta->make_immutable;
1;
####
use strict;
use warnings;
our $VERSION=0.01;
use FindBin qw($Bin);
my $p=PagesGenerator->new_with_config(configfile => "$Bin/pages-temp.yaml");
####
Attribute (pages) does not pass the type constraint because: Validation failed for 'ArrayRef[Page]' with value ARRAY(0x22422e8) at /usr/local/share/perl/5.10.0/MooseX/ConfigFromFile.pm line 44
MooseX::ConfigFromFile::new_with_config('PagesGenerator', 'configfile', 'pages-temp.yaml') called at navigator.pl line 14