[Bast-commits] r4016 - trunk/Class-C3-Componentised/lib/Class/C3
castaway at dev.catalyst.perl.org
castaway at dev.catalyst.perl.org
Sat Feb 2 15:45:57 GMT 2008
Author: castaway
Date: 2008-02-02 15:45:56 +0000 (Sat, 02 Feb 2008)
New Revision: 4016
Modified:
trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm
Log:
Steal class loading code from Class::MOP, and get around errors when trying to load "__PACKAGE__"
Modified: trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm
===================================================================
--- trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm 2008-02-02 00:07:48 UTC (rev 4015)
+++ trunk/Class-C3-Componentised/lib/Class/C3/Componentised.pm 2008-02-02 15:45:56 UTC (rev 4016)
@@ -121,7 +121,9 @@
croak "Invalid class name $f_class"
if ($f_class=~m/(?:\b:\b|\:{3,})/);
return if Class::Inspector->loaded($f_class);
- eval "require $f_class"; # require needs a bareword or filename
+ my $file = $f_class . '.pm';
+ $file =~ s{::}{/}g;
+ eval { CORE::require($file) }; # require needs a bareword or filename
if ($@) {
if ($class->can('throw_exception')) {
$class->throw_exception($@);
More information about the Bast-commits
mailing list