use threads; threads->create(\&start(),""); threads->create(sub {print "started thread\n"},""); threads->join(); sub start() { print "processing ...\n"; while(1) { sleep(5); print "test\n"; threads::yield(); } }