Use Scalar::Util/Carp imports for brevity
Shawn M Moore [Tue, 10 Jun 2008 01:21:38 +0000 (01:21 +0000)]
lib/Mouse.pm
lib/Mouse/Object.pm

index fce4bd8..37f92ca 100644 (file)
@@ -43,11 +43,11 @@ do {
         },
 
         confess => sub {
-            return \&Carp::confess;
+            return \&confess;
         },
 
         blessed => sub {
-            return \&Scalar::Util::blessed;
+            return \&blessed;
         },
     );
 
index 27f914b..dcb8590 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use MRO::Compat;
 
-use Scalar::Util 'blessed';
+use Scalar::Util qw/blessed weaken/;
 use Carp 'confess';
 
 sub new {
@@ -33,7 +33,7 @@ sub new {
 
                     $instance->{$key} = $value;
 
-                    Scalar::Util::weaken($instance->{$key})
+                    weaken($instance->{$key})
                         if $attribute->weak_ref;
                 }
             }
@@ -50,7 +50,7 @@ sub new {
 
             $instance->{$key} = $args{$key};
 
-            Scalar::Util::weaken($instance->{$key})
+            weaken($instance->{$key})
                 if $attribute->weak_ref;
 
             if ($attribute->has_trigger) {