Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Action at a distance

by syphilis (Archbishop)
on Nov 04, 2022 at 12:52 UTC ( [id://11147963]=note: print w/replies, xml ) Need Help??


in reply to Re: Action at a distance
in thread Action at a distance

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147963]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found