use threads; my $thread = async {sleep 10; print "Ok\n"}; my $i = 0; while (1) { $i++; print "$i - $thread\n"; if (??????? $thread finished ??????) {last}; sleep 1; };