#Start new thread my $t1 = threads->new (\&$functions_name1,@parameters1); push(@threads,$t1); my $t2 = threads->new (\&$functions_name2,@parameters2); push(@threads,$t2); my $index=0; my %hash_results = (); foreach my $thread (@threads) #wait for all threads untill the end and insert results to hash { $hash_results{$index}=$thread->join; }