{ package Math::GMP; use overload "+" => sub ($$$) { my($x, $y) = (shift, shift); if(ref($y) eq 'Math::MPFR' || ref($y) eq 'Math::GMPq' || ref($y) eq 'Math::GMPz') { return $y + $x; } return Math::GMP::op_add($x, $y, 0); }; use overload "-" => sub ($$$) { my($x, $y) = (shift, shift); if(ref($y) eq 'Math::MPFR' || ref($y) eq 'Math::GMPq' || ref($y) eq 'Math::GMPz') { return -($y - $x); } return Math::GMP::op_sub($x, $y, shift); }; ....