Note that there are some explanatory texts on larger screens.

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

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload