4 $VERSION = eval $VERSION;
8 my ($method) = our $AUTOLOAD =~ /^curry::(.+)$/;
11 $invocant->$method(@args => @_);
21 Scalar::Util::weaken($invocant) if Scalar::Util::blessed($invocant);
22 my ($method) = our $AUTOLOAD =~ /^curry::weak::(.+)$/;
25 return unless $invocant;
26 $invocant->$method(@args => @_);
34 curry - Create automatic curried method call closures for any class or object
40 my $code = $obj->curry::frobnicate('foo');
44 my $code = sub { $obj->frobnicate(foo => @_) };
50 my $code = $obj->curry::weak::frobnicate('foo');
55 Scalar::Util::weaken(my $weak_obj = $obj);
57 return unless $weak_obj; # in case it already went away
58 $weak_obj->frobnicate(foo => @_)
64 How many times have you written
66 sub { $obj->something($some, $args, @_) }
68 or worse still needed to weaken it and had to check and re-check your code
69 to be sure you weren't closing over things the wrong way?
71 Right. That's why I wrote this.
75 mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>
79 None yet - maybe this software is perfect! (ahahahahahahahahaha)
83 Copyright (c) 2012 the Import::Into L</AUTHOR> and L</CONTRIBUTORS>
88 This library is free software and may be distributed under the same terms