X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FPurePerl.pm;h=fa6a1d74f649c66b709d5c1a643ebafdebbf9e6b;hp=6ab689bc81767b3401949417631443bd0dc21e3f;hb=0ffc4183de68b15deeec5d662d9cc1d125dabf26;hpb=4bc73e4760435ee34876be28bf4522e9e7eaf519 diff --git a/lib/Mouse/PurePerl.pm b/lib/Mouse/PurePerl.pm index 6ab689b..fa6a1d7 100644 --- a/lib/Mouse/PurePerl.pm +++ b/lib/Mouse/PurePerl.pm @@ -11,6 +11,19 @@ use warnings FATAL => 'redefine'; # to avoid to load Mouse::PurePerl use B (); + +# taken from Class/MOP.pm +sub is_valid_class_name { + my $class = shift; + + return 0 if ref($class); + return 0 unless defined($class); + + return 1 if $class =~ /\A \w+ (?: :: \w+ )* \z/xms; + + return 0; +} + sub is_class_loaded { my $class = shift;