check defined rather than truth in weak
[p5sagit/curry.git] / lib / curry.pm
index 5cbaee4..1a9c237 100644 (file)
@@ -1,6 +1,6 @@
 package curry;
 
-our $VERSION = '1.000000';
+our $VERSION = '1.001000';
 $VERSION = eval $VERSION;
 
 our $curry = sub {
@@ -27,7 +27,7 @@ $curry::weak = sub {
   Scalar::Util::weaken($invocant) if Scalar::Util::blessed($invocant);
   my @args = @_;
   sub {
-    return unless $invocant;
+    return unless defined $invocant;
     $invocant->$code(@args => @_)
   }
 };
@@ -38,7 +38,7 @@ sub AUTOLOAD {
   my ($method) = our $AUTOLOAD =~ /^curry::weak::(.+)$/;
   my @args = @_;
   return sub {
-    return unless $invocant;
+    return unless defined $invocant;
     $invocant->$method(@args => @_);
   }
 }