Help for this page

Select Code to Download


  1. or download this
    my $sum = sub { (map {splice @_, 0, 2, $_[0] + ($_[1] // 0)} @_)[-1] }
    +->(@list);
    
  2. or download this
    my $sum = sub { (map {splice @_, 0, 2, $_[0] + ($_[1] // 0)} @_)[-1] }
    +->(0, @list);
    
  3. or download this
    my $sum = reduce { $a + $b } 0, @list;