If that were true, wouldn't replacing "use Foo;" and "use Bar;" with "use MooX::CaptainHook" (before use(ing) Foo or Bar) silence the error? It does not seem to.
On Tue Apr 15 05:48:14 2014, TOBYINK wrote:
Show quoted text> This is a load order problem.
>
> For MooX::ClassAttribute to work with roles, it uses some rather
> convoluted techniques to hook code into Moo role composition and Moo-
> >Moose inflation. This is not fun. These hooks have been parcelled off
> into MooX::CaptainHook to make the rest of MooX::ClassAttribute seem
> less evil.
>
> The hooks need to have been loaded before defining any class hoping to
> compose a role that includes a class attribute. In effect, this means
> that at least MooX::CaptainHook needs to be loaded before any of your
> classes.
>
> Ultimately it would be nice if Moo provided the hooks for this to
> happen, so that MooX::CaptainHook could just become a slim wrapper
> around those hooks. I can't see that happening in the near future.
> (Still, things are improving. There are inflation hooks for attributes
> now.)
>
> Until then, this is probably something I'd consider to be a
> "documentation bug" -- it should be noted that MooX::CaptainHook needs
> to be loaded early.