RosettaCodeData/Task/Concurrent-computing/Perl/concurrent-computing-1.pl
Ingy döt Net 764da6cbbb CDE
2013-04-10 16:57:12 -07:00

9 lines
170 B
Perl

use threads;
use Time::HiRes qw(sleep);
$_->join for map {
threads->create(sub {
sleep rand;
print shift, "\n";
}, $_)
} qw(Enjoy Rosetta Code);