From: Justin Hunter Date: Tue, 1 Feb 2011 19:51:12 +0000 (+0000) Subject: dep on MRO::Compat only if we need to X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=df8450786b6b092b4636aa8f81657540cefd3397;p=p5sagit%2FClass-Accessor-Grouped.git dep on MRO::Compat only if we need to --- diff --git a/Makefile.PL b/Makefile.PL index 996853a..726b26e 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,7 +10,7 @@ all_from 'lib/Class/Accessor/Grouped.pm'; requires 'Carp'; requires 'Scalar::Util'; -requires 'MRO::Compat'; +requires 'MRO::Compat' if $] < 5.009_005; requires 'Class::Inspector'; if (can_cc or $Module::Install::AUTHOR) { @@ -36,10 +36,9 @@ resources repository => 'http://dev.catalyst.perl.org/repos/bast/Class-Accessor-Grouped/trunk'; WriteAll; -use Data::Dumper; if ($Module::Install::AUTHOR) { @{Meta->{values}{requires}} = grep - { $_->[0] !~ /^ (?: Class\:\:XSAccessor | Sub\:\:Name ) $/x } + { $_->[0] !~ /^ (?: Class\:\:XSAccessor | Sub\:\:Name | MRO\:\:Compat ) $/x } @{Meta->{values}{requires}} ; print "Regenerating META with XS requires excluded\n"; diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index d560ba5..229d342 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -3,7 +3,15 @@ use strict; use warnings; use Carp (); use Scalar::Util (); -use MRO::Compat; + +BEGIN { + if ($] < 5.009_005) { + require MRO::Compat; + } + else { + require mro; + } +} our $VERSION = '0.10002'; $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases