use threads; use threads::shared; my $d : shared; $d = shared_clone( mymodule::myfunc() );