use Math::Pari qw/ PARI Mod /; my($n, $p) = map PARI($_), (3, 17); my $recip = PARI(1) / Mod($n, $p); print "1 / $n == $recip\n"; #### $int = int($recip); PARI: *** incorrect type in comparison. at -e line 1. $int = pari2num($recip); PARI: *** forbidden assignment t_INTMOD --> t_REAL. at -e line 1. $int = pari2iv($recip); PARI: *** incorrect type in gtolong. at -e line 1.