Subject: | These functions seem like they'd be fairly useful (untested though) |
sub map {
my %args = @_;
my ($in, $out, $code) = @args{qw/in out callback/};
local ($_, $.);
while (($., $_) = each @$in) {
push @$out, $code->();
}
[200, "OK"];
}
sub grep {
my %args = @_;
my ($in, $out, $code) = @args{qw/in out callback/};
local ($_, $.);
while (($., $_) = each @$in) {
push @$out, $_ if $code->();
}
[200, "OK"];
}
Also of use might be implementations of List::Util::first, List::Util::reduce, List::MoreUtils::natatime, List::MoreUtils::each_array, List::MoreUtils::part.
If you're interested, I can contribute them with proper test cases, documentation, etc.