develooper Front page | perl.moose | Postings from July 2011

RE: Using Moose with

Thread Previous
July 18, 2011 16:19
RE: Using Moose with
Message ID:
It works now.

I had to install both

When I installed only MooseX::NonMoose::InsideOut I got the following.
Thanks for your quick/kind response.


$ perl -e 'use c; $a = c->new( host => "fred" );  print $a->name '
Can't locate MooseX/InsideOut/Role/Meta/ in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .). at /usr/local/lib64/perl5/Class/ line 135
	Class::MOP::load_first_existing_class('MooseX::InsideOut::Role::Meta::Instance') called at /usr/local/lib64/perl5/Class/ line 140
	Class::MOP::load_class('MooseX::InsideOut::Role::Meta::Instance', undef) called at /usr/local/lib64/perl5/Moose/ line 131
	Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0x25d0fc0)', undef, 'MooseX::InsideOut::Role::Meta::Instance') called at /usr/local/lib64/perl5/Moose/ line 98
	Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0x25d0fc0)', 'MooseX::InsideOut::Role::Meta::Instance') called at /usr/local/lib64/perl5/Moose/Meta/ line 104
	Moose::Meta::Class::create('Moose::Meta::Class', 'Moose::Meta::Class::__ANON__::SERIAL::3', 'roles', 'ARRAY(0x2548438)', 'weaken', '', 'superclasses', 'ARRAY(0x2548450)') called at /usr/local/lib64/perl5/Class/MOP/ line 121
	Class::MOP::Package::create_anon('Moose::Meta::Class', 'superclasses', 'ARRAY(0x2548450)', 'roles', 'ARRAY(0x2548438)', 'cache', 1) called at /usr/local/lib64/perl5/Class/MOP/ line 473
	Class::MOP::Class::create_anon_class('Moose::Meta::Class', 'superclasses', 'ARRAY(0x2548450)', 'roles', 'ARRAY(0x2548438)', 'cache', 1) called at /usr/local/lib64/perl5/Moose/Util/ line 134
	Moose::Util::MetaRole::_make_new_class('Moose::Meta::Instance', 'ARRAY(0x2548438)') called at /usr/local/lib64/perl5/Moose/Util/ line 95
	Moose::Util::MetaRole::_make_new_metaclass('Moose::Meta::Class=HASH(0x2403378)', 'HASH(0x2548480)', 'class') called at /usr/local/lib64/perl5/Moose/Util/ line 28
	Moose::Util::MetaRole::apply_metaroles('for', 'c', 'class_metaroles', 'HASH(0x2548480)') called at /usr/local/lib64/perl5/Moose/ line 624
	Moose::Exporter::__ANON__('MooseX::NonMoose::InsideOut', 'for_class', 'MooseX::NonMoose::Meta::Role::Constructor', 'metaclass', undef, 'meta_name', 'meta') called at /usr/local/share/perl5/MooseX/NonMoose/ line 24
	MooseX::NonMoose::InsideOut::init_meta('MooseX::NonMoose::InsideOut', 'for_class', 'MooseX::NonMoose::Meta::Role::Constructor', 'metaclass', undef, 'meta_name', 'meta') called at /usr/local/lib64/perl5/Moose/ line 420
	Moose::Exporter::__ANON__('MooseX::NonMoose::InsideOut') called at line 4
	c::BEGIN() called at /usr/local/share/perl5/MooseX/NonMoose/ line 4
	eval {...} called at /usr/local/share/perl5/MooseX/NonMoose/ line 4
	require called at -e line 1
	main::BEGIN() called at /usr/local/share/perl5/MooseX/NonMoose/ line 4
	eval {...} called at /usr/local/share/perl5/MooseX/NonMoose/ line 4
BEGIN failed--compilation aborted at line 4.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

-----Original Message-----
From: Jesse Luehrs [] 
Sent: Monday, July 18, 2011 4:46 PM
Subject: Re: Using Moose with

On Mon, Jul 18, 2011 at 10:18:25PM +0000, Arne Romo wrote:
> I need help understanding how to use Moose to "extend"
> It occurred to me that since is a non-moose module I need the
>     "use MooseX::NonMoose;"
> but my simple test program still fails.
> Below I've include my simple perl script showing it fail when I use the
> "extends" and passing if I comment out the "extends".
> Clearly I'm missing something or need some higher level kungfu here 8)
> Any help / simple working example would be greatly appreciated.
> This is my first foray into the Moose world so I'm just starting to learn
> this critter.
>     -Arne doesn't use hashrefs for objects, so you need to tell Moose
how to handle that. The easiest way is to use
MooseX::NonMoose::InsideOut rather than MooseX::NonMoose.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About