Some errors for auto_deref
[gitmo/Mouse.git] / lib / Mouse.pm
index ff3da1e..58637af 100644 (file)
@@ -82,8 +82,11 @@ do {
 
 sub load_class {
     my $class = shift;
-    return if ref($class);
-    return unless defined($class) && length($class);
+
+    if (ref($class) || !defined($class) || !length($class)) {
+        my $display = defined($class) ? $class : 'undef';
+        confess "Invalid class name ($display)";
+    }
 
     return 1 if is_class_loaded($class);
 
@@ -210,6 +213,12 @@ This will load a given C<Class::Name> (or die if it's not loadable).
 This function can be used in place of tricks like
 C<eval "use $module"> or using C<require>.
 
+=head2 is_class_loaded Class::Name -> Bool
+
+Returns whether this class is actually loaded or not. It uses a heuristic which
+involves checking for the existence of C<$VERSION>, C<@ISA>, and any
+locally-defined method.
+
 =head1 AUTHOR
 
 Shawn M Moore, C<< <sartak at gmail.com> >>