![]() |
|
The stupid question is the question not asked | |
PerlMonks |
Re^2: Action at a distanceby syphilis (Archbishop) |
on Nov 04, 2022 at 12:52 UTC ( #11147963=note: print w/replies, xml ) | Need Help?? |
My favourite workaround for this is to write $x = $bi * 1; Yes, that works fine ... for those who: 1) are aware that it's needed; and 2) remember to do it. I'd like a better solution, but I don't yet see that one exists. You can also work around the problem by doing $x = Math::BigInt->new($bi), but the brevity of doing $x = $bi is a very attractive alternative ... or, at least, would be if it DWIMmed. Doing $x = $bi will not call the sub that overloads '=' until an attempted modification of the value of $x has been detected and, while doing $x++ triggers that detection, doing $x->binc() apparently does not. Thanks for the thoughts so far. Is there something already posted in this thread to which I should pay more attention ? Cheers, Rob
In Section
Seekers of Perl Wisdom
|
|