use threads; sub YourSub { ... return $result; } ... my $thread = threads->new( \&YourSub, $arg1, $arg2, ... ); # If your not interested in the result from the sub then # $thread->detach; .... # Otherwise, this will retrieve the return value. # Note: This will block until the thread finishes. # One (of several) things missing from the API as it stands # is any way to determine if the thread has finished # without blocking. my $result = $thread->join;