Help for this page

Select Code to Download


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