http://qs321.pair.com?node_id=11147934


in reply to Action at a distance

This is deliberate behaviour of Math::BigInt: they are objects, and $x = $y just copies the reference. See the section on "Modifying and =" under CAVEATS. You will see also that binc() is documented in a section Arithmetic methods which is headed "These methods modify the invocand object and returns it" (sic).

Generally the module is designed such that if you treat the objects as numbers it will attempt to do what is needed to preserve that illusion; if you treat them as objects, by calling methods on them, you need to read rather more of the docs.