}
-use Carp qw(confess);
-use Scalar::Util qw(blessed);
+use Carp ();
+use Scalar::Util ();
use constant _MOUSE_VERBOSE => !!$ENV{MOUSE_VERBOSE};
}
# not found
- confess join(
+ Carp::confess join(
"\n",
map {
sprintf( "Could not load class (%s) because : %s",
unless ( is_valid_class_name($class) ) {
my $display = defined($class) ? $class : 'undef';
- confess "Invalid class name ($display)";
+ Carp::confess "Invalid class name ($display)";
}
return undef if $is_class_loaded_cache{$class} ||= is_class_loaded($class);
sub load_class {
my $class = shift;
my $e = _try_load_one_class($class);
- confess "Could not load class ($class) because : $e" if $e;
+ Carp::confess "Could not load class ($class) because : $e" if $e;
return 1;
}
sub apply_all_roles {
- my $applicant = blessed($_[0]) ? shift : Mouse::Meta::Class->initialize(shift);
+ my $applicant = Scalar::Util::blessed($_[0])
+ ? shift # instance
+ : Mouse::Meta::Class->initialize(shift); # class or role name
my @roles;