- or download this
for ( 1..2 ) {
threads -> create ( \&worker );
}
- or download this
for ( 1..2 ) {
my $temp_scalar = threads -> create ( \&worker );
}
- or download this
$ perl pm_1228826.pl
sum=1
sum=2
- or download this
use strict;
use warnings;
...
my $sum=$thr -> join;
print "sum=$sum\n";
}