Help for this page

Select Code to Download


  1. or download this
    use 6; # require perl v6
    use List::Util qw/reduce/;
    
    @foobar = @{reduce{[@$a ^+ @$b]}\(@foo, @bar, @baz, @etc)};
    
  2. or download this
    use List::Util qw/reduce/;
    
    @foobar = @{reduce{[map $a->[$_]+$b->[$_], 0..@$a>@$b?$#$a:$#$b]}
                       \(@foo, @bar, @baz, @etc};