I also tried with Catalyst::ClassData. Must be missing something. All modules up to date. On Perl 5.10.0.
$ catalyst.pl MyApp $ cat lib/Catalyst/Plugin/Role.pm package Catalyst::Plugin::Role; use Moose::Role; use MooseX::ClassAttribute; class_has 'Cache' => ( is => 'rw', isa => 'HashRef', default => sub { {} }, ); 1; $ script/myapp_server.pl Could not load class (Catalyst::Plugin::Role) because : Catalyst::Plugin::Role already has a metaclass, but it does not inherit Moose::Meta::Class (Moose::Meta::Role=HASH(0xa38ff10)) at /usr/local/share/perl/5.10.0/Moose.pm line 162 Moose::init_meta('Moose', 'metaclass', undef, 'for_class', 'Catalyst::Plugin::Role') called at /usr/local/share/perl/5.10.0/MooseX/ClassAttribute.pm line 22 MooseX::ClassAttribute::init_meta('MooseX::ClassAttribute', 'for_class', 'Catalyst::Plugin::Role', 'metaclass', undef) called at /usr/local/share/perl/5.10.0/Moose/Exporter.pm line 405 Moose::Exporter::__ANON__('MooseX::ClassAttribute') called at /home/moseley/MyApp/script/../lib/Catalyst/Plugin/Role.pm line 3 Catalyst::Plugin::Role::BEGIN() called at /usr/local/share/perl/5.10.0/MooseX/ClassAttribute.pm line 3 eval {...} called at /usr/local/share/perl/5.10.0/MooseX/ClassAttribute.pm line 3 require Catalyst/Plugin/Role.pm called at /usr/local/lib/perl/5.10.0/Class/MOP.pm line 134 eval {...} called at /usr/local/lib/perl/5.10.0/Class/MOP.pm line 134 Class::MOP::_try_load_one_class('Catalyst::Plugin::Role') called at /usr/local/lib/perl/5.10.0/Class/MOP.pm line 95 Class::MOP::load_first_existing_class('Catalyst::Plugin::Role') called at /usr/local/lib/perl/5.10.0/Class/MOP.pm line 140 Class::MOP::load_class('Catalyst::Plugin::Role') called at /usr/local/share/perl/5.10.0/Catalyst.pm line 2563 Catalyst::setup_plugins('MyApp', 'ARRAY(0xa2d1598)') called at /usr/local/share/perl/5.10.0/Catalyst.pm line 1028 Catalyst::setup('MyApp') called at /home/moseley/MyApp/script/../lib/MyApp.pm line 35 require MyApp.pm called at script/myapp_server.pl line 66 main::__ANON__() called at script/myapp_server.pl line 107 BEGIN failed--compilation aborted at /home/moseley/MyApp/script/../lib/Catalyst/Plugin/Role.pm line 3. Compilation failed in require at /usr/local/lib/perl/5.10.0/Class/MOP.pm line 134. at /usr/local/lib/perl/5.10.0/Class/MOP.pm line 119 Class::MOP::load_first_existing_class('Catalyst::Plugin::Role') called at /usr/local/lib/perl/5.10.0/Class/MOP.pm line 140 Class::MOP::load_class('Catalyst::Plugin::Role') called at /usr/local/share/perl/5.10.0/Catalyst.pm line 2563 Catalyst::setup_plugins('MyApp', 'ARRAY(0xa2d1598)') called at /usr/local/share/perl/5.10.0/Catalyst.pm line 1028 Catalyst::setup('MyApp') called at /home/moseley/MyApp/script/../lib/MyApp.pm line 35 require MyApp.pm called at script/myapp_server.pl line 66 main::__ANON__() called at script/myapp_server.pl line 107 Compilation failed in require at script/myapp_server.pl line 66. With Catalyst::ClassData: mose...@bumby2:~/MyApp$ cat lib/Catalyst/Plugin/Role.pm package Catalyst::Plugin::Role; use Moose::Role; use Catalyst::ClassData; __PACKAGE__->mk_classdata( 'foo' ); 1; mose...@bumby2:~/MyApp$ script/myapp_test.pl / Could not load class (MyApp) because : Could not load class (Catalyst::Plugin::Role) because : Can't locate object method "mk_classdata" via package "Catalyst::Plugin::Role" at /home/moseley/MyApp/script/../lib/Catalyst/Plugin/Role.pm line 5. Compilation failed in require at /usr/local/lib/perl/5.10.0/Class/MOP.pm line 134. ... -- Bill Moseley mose...@hank.org _______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/