for ( 1..$thrCount ) { threads -> create ( \&http_fetch_thread ); } open ( my $contents, "<", $contents_file_name ) or die $!; $url_q -> enqueue ( <$contents> ); $url_q -> end; close ( $contents ); #wait for completion foreach my $thr ( threads -> list() ) { $thr -> join(); #not capturing return code, we started in a void context. } print "At program completion, total count was ", $totalCount,"\n";