my %siteHash : shared; my $thread = threads->new( sub { my( $address, $hashref ) = @_; my $downloader = eval{ Downloader->new } or die $@; $downloader->fetch( $address, $hashref ); }, $address, \%siteHash ) or die $!; ## do other stuff $thread->join;