package Catalyst::ClassData;
use Moose::Role;
+use Moose::Meta::Class ();
use Class::MOP;
-use Class::MOP::Object;
+use Moose::Util ();
sub mk_classdata {
my ($class, $attribute) = @_;
my $slot = '$'.$attribute;
my $accessor = sub {
my $pkg = ref $_[0] || $_[0];
- # Hack - delberately create a metaclass instance
- my $meta = $pkg->Class::MOP::Object::meta();
+ my $meta = Moose::Util::find_meta($pkg)
+ || Moose::Meta::Class->initialize( $pkg );
if (@_ > 1) {
$meta->namespace->{$attribute} = \$_[1];
return $_[1];
=head1 COPYRIGHT
-This program is free software, you can redistribute it and/or modify it under
+This library is free software. You can redistribute it and/or modify it under
the same terms as Perl itself.
=cut