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