My first Role is the following one:
package AccBack::RTransaction;
use strict;
use warnings;
use Moose::Role;
use MooseX::Method::Signatures;
requires "_log";
requires "_config";
My second Role, which implement the first Role, is the following one:
package AccBack::RAccounting;
use AccBack::RTransaction;
requires "_log";
has "_config" => (
isa => "Accounting::Config",
is => "ro",
lazy => 1,
default => sub { return Accounting::Config->new(); }
);
has "fibu" => (
isa => "Maybe[Accounting::Fibu]",
is => "rw",
writer => "setFibu",
reader => "getFibu",
default => undef,
);
with "AccBack::RTransaction";
My base class is the following one:
package AccBack::Membership;
use AccBack::RAccounting;
has "_log" => (
isa => "Log::Log4perl::Logger",
is => "ro",
default => sub {
return Log::Log4perl->get_logger("AccBack::Membership");
}
);
has "mailMergeOption" => (
isa => "Maybe[HashRef]",
is => "rw",
writer => "setMailMergeOption",
reader => "getMailMergeOption",
default => undef,
);
# Roles
with "AccBack::RAccounting";
If I wan't to start my program, I get this error:
'AccBack::RAccounting' requires the method '_config' to be implemented by 'AccBack::Membership' at C:/strawberry/perl/site/lib/Moose/Meta/Role/Application/ToCla
I don't understand where the problem is. It is the same things as http://search.cpan.org/~doy/Moose-2.0203/lib/Moose/Cookbook/Roles/Recipe1.pod.
Does anybody have an idea about what I've misunderstand?