in reply to Re: Moops: meta not available in role
in thread Moops: meta not available in role
According to the INCOMPATIBILITIES_WITH_MOOSE section of the Moo documentation, Moo does not have a meta object.
AHA! I had totally forgotten that about Moo. That is exactly the issue. (And I totally should have known that by the fact that I was calling a Moose::Util method ...)
Adding using Moose to your code fixes the issue.
Well, yes, but what I really wanted was a way to do what I was trying to do in Moo. But, now that I look at it more closely, I don't believe Moo supports traits at all ... not even in any sort of MooX module. Possibly Moo is unable to do attribute traits due the lack of a MOP. So I guess do need to take your suggestion and just tell Moops to use Moose everywhere. (To wit, I think I'll use MoopsX::UsingMoose.)
So here's some code which works:
use MoopsX::UsingMoose; use autodie qw< :all >; role Foo { use Data::Printer; p __PACKAGE__->meta; }
Note that, after more careful reading of the Moops docs, I figured out that I don't need the use v5.14 line, nor the use warnings line, nor even the 1; at the end of the module: Moops itself will do all that for me. Cool.
Thx for the assist, kevbot.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Moops: meta not available in role
by 1nickt (Canon) on Jul 29, 2015 at 04:32 UTC | |
by Anonymous Monk on Jul 29, 2015 at 07:17 UTC |