#!perl -slw use strict; use threads; sub one { select('','','',rand(0.01)), print 'one' while 1; } sub two { select('','','',rand(0.01)), print 'two' while 2; } async \&one; two;