From: Dave Rolsky Date: Thu, 28 Aug 2008 15:06:56 +0000 (+0000) Subject: Instead of loading by path, we let Perl do its thing and load by X-Git-Tag: 0.64_07~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=40b017cf19e39ab8df0c00951746570ea31a9e11;p=gitmo%2FClass-MOP.git Instead of loading by path, we let Perl do its thing and load by module name. For some reason, this fixes a bug that tokuhirom found in Moose (t/030_roles/031_roles_applied_in_create.t), which seemed to have something to do with load order of the various roles. Go figure. --- diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index cd7dc71..cbe2eae 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -104,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; }