Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Moops: meta not available in role

by Oberon (Monk)
on Jul 28, 2015 at 23:18 UTC ( [id://1136674]=note: print w/replies, xml ) Need Help??


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

    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.

    FYI if you are writing a module for CPAN distribution, you will be penalized in kwalitee if you omit use warnings; or use strict; from your code, even if you are using Moo(se|ps). Not sure about the other "features."

    The way forward always starts with a minimal test.

      FYI if you are writing a module for CPAN distribution, you will be penalized in kwalitee if you omit use warnings; or use strict; from your code, even if you are using Moo(se|ps). Not sure about the other "features."

      So you found a bug in some "kwalitee" module/service?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1136674]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-23 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found