use Thread::Pool; my $pool = Thread::Pool->new(Min => 5, Max => 10);