Only use applied_attribute metarole with new Moose
Dave Rolsky [Sat, 26 Feb 2011 18:54:42 +0000 (12:54 -0600)]
lib/MooseX/FollowPBP.pm

index e19c904..b9a5679 100644 (file)
@@ -8,15 +8,18 @@ use Moose::Exporter;
 use Moose::Util::MetaRole;
 use MooseX::FollowPBP::Role::Attribute;
 
-Moose::Exporter->setup_import_methods(
+my %metaroles = (
     class_metaroles => {
         attribute => ['MooseX::FollowPBP::Role::Attribute'],
     },
-    role_metaroles => {
-        applied_attribute => ['MooseX::FollowPBP::Role::Attribute'],
-    },
 );
 
+$metaroles{role_metaroles} = {
+    applied_attribute => ['MooseX::FollowPBP::Role::Attribute'],
+} if $Moose::VERSION >= 1.9900;
+
+Moose::Exporter->setup_import_methods(%metaroles);
+
 1;
 
 # ABSTRACT: Name your accessors get_foo() and set_foo()