From: Brandon L Black Date: Sun, 17 Dec 2006 18:52:10 +0000 (+0000) Subject: fix up C3.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=892f8387172d8067eef0db8bc93a50fbbaf1969b;p=gitmo%2FClass-C3.git fix up C3.pm --- diff --git a/lib/Class/C3.pm b/lib/Class/C3.pm index efe0f9f..b5032a9 100644 --- a/lib/Class/C3.pm +++ b/lib/Class/C3.pm @@ -5,15 +5,16 @@ use strict; use warnings; use Scalar::Util 'blessed'; -use Algorithm::C3; -use B (); our $VERSION = '0.14'; our $C3_IN_CORE; BEGIN { eval { require mro }; - if(!$@ && &mro::get_mro_linear_c3) { + if($@) { + require Algorithm::C3; + } + else { $C3_IN_CORE = 1; } } @@ -48,7 +49,7 @@ sub import { return if $class eq 'main'; return if $TURN_OFF_C3; if($C3_IN_CORE) { - B::enable_c3mro($class); + mro::set_mro_c3($class); } # make a note to calculate $class # during INIT phase