X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FC3.pm;h=70dd4c146414050e31cf3ed4a5dd16093b370563;hb=5da160438e8351dbdd7783d6a188083c84f4c4d9;hp=baca46da6ed08e8d8097750c95c7493f93bae20f;hpb=c5785624dc4f0933fecda24f25349181b53e82e2;p=gitmo%2FClass-C3.git diff --git a/lib/Class/C3.pm b/lib/Class/C3.pm index baca46d..70dd4c1 100644 --- a/lib/Class/C3.pm +++ b/lib/Class/C3.pm @@ -4,7 +4,7 @@ package Class::C3; use strict; use warnings; -our $VERSION = '0.17'; +our $VERSION = '0.20'; our $C3_IN_CORE; our $C3_XS; @@ -12,6 +12,7 @@ our $C3_XS; BEGIN { if($] > 5.009_004) { $C3_IN_CORE = 1; + require mro; } else { eval "require Class::C3::XS"; @@ -66,6 +67,11 @@ sub import { ## initializers +# This prevents silly warnings when Class::C3 is +# used explicitly along with MRO::Compat under 5.9.5+ + +{ no warnings 'redefine'; + sub initialize { %next::METHOD_CACHE = (); # why bother if we don't have anything ... @@ -99,6 +105,8 @@ sub uninitialize { sub reinitialize { goto &initialize } +} # end of "no warnings 'redefine'" + ## functions for applying C3 to classes sub _calculate_method_dispatch_tables {