curry - Create automatic curried method call closures for any class or object
use curry; my $code = $obj->curry::frobnicate('foo');
is equivalent to:
my $code = sub { $obj->frobnicate(foo => @_) };
Additionally,
use curry::weak; my $code = $obj->curry::weak::frobnicate('foo');
my $code = do { Scalar::Util::weaken(my $weak_obj = $obj); sub { return unless $weak_obj; # in case it already went away $weak_obj->frobnicate(foo => @_) }; };
How many times have you written
sub { $obj->something($some, $args, @_) }
or worse still needed to weaken it and had to check and re-check your code to be sure you weren't closing over things the wrong way?
Right. That's why I wrote this.
mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>
None yet - maybe this software is perfect! (ahahahahahahahahaha)
Copyright (c) 2012 the curry "AUTHOR" and "CONTRIBUTORS" as listed above.
This library is free software and may be distributed under the same terms as perl itself.
To install curry, copy and paste the appropriate command in to your terminal.
cpanm
cpanm curry
CPAN shell
perl -MCPAN -e shell install curry
For more information on module installation, please visit the detailed CPAN module installation guide.