use warnings; use strict; use threads; use Math::MPFR qw(:mpfr); my ($x, $inex) = Rmpfr_init_set_d_nobless(11.625, MPFR_RNDN); my $thr1 = threads->create( sub { print Rmpfr_get_d($x, MPFR_RNDN), "\n"; return 23; } ); my $res = $thr1->join(); Math::MPFR::DESTROY($x); print $res; __END__ OUTPUTS: 11.625 23