my $dbh; sub init { $dbh = DBI->connect(...); ... } my $pool = Thread::Pool::Simple->new( ... init => [ \&init ], ... );