sub worker { .... } ... my @workers = map threads->new( \&worker, ... ), 1 .. $WORKERS;