Use the same _is_valid_class_name check in is_class_loaded
Shawn M Moore [Tue, 25 Nov 2008 07:36:15 +0000 (07:36 +0000)]
lib/Class/MOP.pm

index 43e5192..a72de08 100644 (file)
@@ -173,7 +173,7 @@ sub _is_valid_class_name {
 sub is_class_loaded {
     my $class = shift;
 
-    return 0 if ref($class) || !defined($class) || !length($class);
+    return 0 unless _is_valid_class_name($class);
 
     # walk the symbol table tree to avoid autovififying
     # \*{${main::}{"Foo::"}} == \*main::Foo::