Help for this page

Select Code to Download


  1. or download this
    my $i;
    for (0..10) {
      $i += $_;
    }
    
  2. or download this
    my $sum = operate { $~ + $_ } (0..10);
    
  3. or download this
    #Max:
    my $max = operate { $~ > $_ ? $~ : $_ } @list;
    ...
    my $string = operate { $~.$_ } @list; 
    #Count occurences of words in a file:
    my $count = operate { $~ + /the/ } <FILE>;