Instead of loading by path, we let Perl do its thing and load by
[gitmo/Class-MOP.git] / lib / Class / MOP.pm
index bebc422..cbe2eae 100644 (file)
@@ -4,6 +4,8 @@ package Class::MOP;
 use strict;
 use warnings;
 
+use 5.008;
+
 use MRO::Compat;
 
 use Carp          'confess';
@@ -26,7 +28,7 @@ BEGIN {
         require Devel::GlobalDestruction;
         Devel::GlobalDestruction->import("in_global_destruction");
         1;
-    } or *in_global_destruction = sub () { '' };
+    } or *in_global_destruction = sub () { !1 };
 }
 
 
@@ -46,7 +48,9 @@ BEGIN {
         : sub () { 1 };
 }
 
-our $VERSION   = '0.65';
+our $VERSION   = '0.64_06';
+our $XS_VERSION = $VERSION;
+$VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';    
     
 # after that everything is loaded, if we're allowed try to load faster XS
@@ -56,7 +60,7 @@ unless ($ENV{CLASS_MOP_NO_XS}) {
         local $@;
         eval {
             require XSLoader;
-            __PACKAGE__->XSLoader::load($VERSION);
+            __PACKAGE__->XSLoader::load($XS_VERSION);
         };
         $@;
     };
@@ -100,9 +104,7 @@ sub load_class {
     # if the class is not already loaded in the symbol table..
     unless (is_class_loaded($class)) {
         # require it
-        my $file = $class . '.pm';
-        $file =~ s{::}{/}g;
-        my $e = do { local $@; eval { require($file) }; $@ };
+        my $e = do { local $@; eval "require $class"; $@ };
         confess "Could not load class ($class) because : $e" if $e;
     }
 
@@ -562,7 +564,7 @@ Class::MOP::Instance->meta->add_attribute(
 
 Class::MOP::Instance->meta->add_attribute(
     Class::MOP::Attribute->new('attributes',
-        reader   => { attributes => \&Class::MOP::Instance::attributes },
+        reader   => { attributes => \&Class::MOP::Instance::get_all_attributes },
     ),
 );