From: gfx Date: Tue, 27 Oct 2009 04:51:42 +0000 (+0900) Subject: No import X-Git-Tag: 0.40_02~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5dd5edef56ebdfeb7747114850dfb73a1acd4cd5;p=gitmo%2FMouse.git No import --- diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index 948aa16..7413e9f 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -29,8 +29,8 @@ BEGIN{ } -use Carp qw(confess); -use Scalar::Util qw(blessed); +use Carp (); +use Scalar::Util (); use constant _MOUSE_VERBOSE => !!$ENV{MOUSE_VERBOSE}; @@ -198,7 +198,7 @@ sub load_first_existing_class { } # not found - confess join( + Carp::confess join( "\n", map { sprintf( "Could not load class (%s) because : %s", @@ -214,7 +214,7 @@ sub _try_load_one_class { 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); @@ -233,7 +233,7 @@ sub _try_load_one_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; } @@ -242,7 +242,9 @@ sub is_class_loaded; 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;