We don't bite newbies here... much | |
PerlMonks |
Re^2: Moops: meta not available in roleby Oberon (Monk) |
on Jul 28, 2015 at 23:18 UTC ( [id://1136674]=note: print w/replies, xml ) | Need Help?? |
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:
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.
In Section
Seekers of Perl Wisdom
|
|