Oberon has asked for the wisdom of the Perl Monks concerning the following question:
This doesn't seem to work for me:
use v5.14.4; use warnings; use autodie qw< :all >; use Moops; role Foo { #use Moose::Role; use Data::Printer; p __PACKAGE__->meta; } 1;
First of all, should it? If not, why not? Note that if you uncomment the commented line, then it works fine. But that seems redundant to me.
To clarify, when I say "doesn't work," what I mean is:
Can't locate object method "meta" via package "Foo" at test.pm line 12 +. BEGIN failed--compilation aborted at test.pm line 13.
What I really want to do is this:
role Foo { use Moose::Util; Moose::Util::meta_attribute_alias 'Foo'; }
but not being able to get the meta means that fails as well:
Can't call method "isa" on an undefined value at /home/buddy/perl5/perlbrew/perls/perl-5.14.4/lib/site_perl/5.14.4/x86_64-linux/Moose/Util.pm line 335.Enlighten me, O fellow monks. What is the magical Moops incantation I'm missing here?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Moops: meta not available in role
by kevbot (Vicar) on Jul 28, 2015 at 06:35 UTC | |
by Oberon (Monk) on Jul 28, 2015 at 23:18 UTC | |
by 1nickt (Canon) on Jul 29, 2015 at 04:32 UTC | |
by Anonymous Monk on Jul 29, 2015 at 07:17 UTC | |
|
Re: Moops: meta not available in role
by Anonymous Monk on Jul 28, 2015 at 03:15 UTC | |
by Anonymous Monk on Jul 28, 2015 at 10:09 UTC | |
by Oberon (Monk) on Jul 28, 2015 at 21:57 UTC |