Help for this page

Select Code to Download


  1. or download this
    use List::Util qw /reduce/;
    say reduce { $a + length $b } 0, @many_strings;
    
  2. or download this
    use v5.38;
    use List::MoreUtils qw/reduce_0/;
    my @many_strings = ("abc", "cd", "e", "fg", "hi", "hello world");
    say reduce_0 { $a + length $b } @many_strings;