Help for this page

Select Code to Download


  1. or download this
    use List::Util qw(reduce); # from the CPAN
    
    my $max = reduce { $a > $b ? $a : $b } @list;
    my $string = reduce {$a . $b } @list;
    
  2. or download this
    my $count = reduce { $a + $b =~ /the/ } 0, <FILE>;