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::(.+)$/;
25 $invocant->$method(@args => @_);
33 curry - Create automatic curried method call closures for any class or object
39 my $code = $obj->curry::frobnicate('foo');
43 my $code = sub { $obj->frobnicate(foo => @_) };
49 my $code = $obj->curry::weak::frobnicate('foo');
54 Scalar::Util::weaken(my $weak_obj = $obj);
55 sub { $weak_obj->frobnicate(foo => @_) };
60 How many times have you written
62 sub { $obj->something($some, $args, @_) }
64 or worse still needed to weaken it and had to check and re-check your code
65 to be sure you weren't closing over things the wrong way?
67 Right. That's why I wrote this.
71 mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>
75 None yet - maybe this software is perfect! (ahahahahahahahahaha)
79 Copyright (c) 2012 the Import::Into L</AUTHOR> and L</CONTRIBUTORS>
84 This library is free software and may be distributed under the same terms