- or download this
@foobar = reduce {[@^a ^+ @^b]} @foo, @bar, @baz, @etc;
- or download this
{[@^a ^+ @^b]}
- or download this
sub (@a, @b) { return [@a ^+ @b] }
- or download this
# sum of maximal values...
$maxsum = reduce { $^a + max(@^b) } 0, @foo, @bar, @etc;
- or download this
# grep out hash entries whose key *or* value is 'moo'...
%cow = map { any($^key,$^val) eq 'moo' ?? $^key => $^val :: () } %
+animals;
- or download this
sub ($key, $val) { ... }