RosettaCodeData/Task/Concurrent-computing/Perl/concurrent-computing-1.pl

10 lines
170 B
Perl
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
use threads;
use Time::HiRes qw(sleep);
$_->join for map {
threads->create(sub {
sleep rand;
print shift, "\n";
}, $_)
} qw(Enjoy Rosetta Code);