Subject: | Closure-friendly List::Util::reduce() |
I would like to be able to do the following:
my @f = (
sub { "a" },
sub { "b" },
sub { "c" },
sub { "d" },
sub { "e" },
);
my $f = reduce { sub { $a->() . $b->() } } ( sub { '' }, @f );
Of course, $f->() should return 'abcde'.
Is there a way to do this currently or is it possible to modify reduce
for this?