- or download this
sub { ( map { splice @_, 0, 2, $_[0] + ($_[1] // 0) } @_ )[-1] }->(0,
+@list)
- or download this
sub { ( splice(@_, 0, 0, 0), ( map $_[0] += $_, @_) )[-1] }->(@list)
- or download this
sub { splice(@_, 0, 0, 0); map $_[0] += $_, @_; $_[0] }->(@list)
- or download this
sub { my $acc = 0; map $acc += $_, @_; $acc }->(@list)
- or download this
sub { my $acc = 0; $acc += $_ for @_; $acc }->(@list)