- or download this
sub operate (&@) {
my $sub = shift;
local $~;
$~ = &$sub($_) for @_;
return $~
}
- or download this
use strict;
sub operate (&@) {
my $sub = shift;
...
open FILE, $0;
my $count = operate { $~ + /operate/ } <FILE>;
print "Count = $count\n";
- or download this
max = 645
string = 462671236452354
count = 4