From: Fuji, Goro Date: Sun, 5 Dec 2010 05:23:05 +0000 (+0900) Subject: Fix for SL4A where mro.pm doesn't exist even if Perl >= 5.10.0 X-Git-Tag: 0.88~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4a5a984709fab07209787e699c3d3d8ac1e6a6e2;p=gitmo%2FMouse.git Fix for SL4A where mro.pm doesn't exist even if Perl >= 5.10.0 --- diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index e3999c3..8adab40 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -127,10 +127,10 @@ sub does_role{ BEGIN { my $get_linear_isa; - if ($] >= 5.009_005) { - require mro; + if (eval { require mro }) { $get_linear_isa = \&mro::get_linear_isa; - } else { + } + else { # this code is based on MRO::Compat::__get_linear_isa my $_get_linear_isa_dfs; # this recurses so it isn't pretty $_get_linear_isa_dfs = sub { @@ -442,7 +442,7 @@ C or using C. =head3 C<< Mouse::Util::get_all_metaclass_names() -> (ClassNames) >> -=head2 MRO::Compat +=head2 mro (or MRO::Compat) =head3 C @@ -466,6 +466,8 @@ L L +L + L =cut diff --git a/xt/002-pod_spell.t b/xt/002-pod_spell.t index dc94220..f10f10a 100644 --- a/xt/002-pod_spell.t +++ b/xt/002-pod_spell.t @@ -188,6 +188,7 @@ namespacing transformability redispatch MISC +mro # as in required-ness ness