my @search = grep /^_/, param(); # now remove the underscores $_ = substr($_,1) for @search; # now create the threads; my @thread = map { threads->new(sub {get_search($_)})}, @search; # and finally, join them when done $_->join for @thread;