Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Pre-caching large constants

by chromatic (Archbishop)
on Feb 08, 2002 at 21:26 UTC ( [id://144240]=note: print w/replies, xml ) Need Help??


in reply to Pre-caching large constants

Write a new class derived from Tie::Scalar. In its FETCH() method, create the constant with Math::BigFloat, then replace the tied scalar with the constant. The float will only be created on the first access.

Disclaimer: I have not (yet) tried this, but I'm pretty confident.

Update: I have tried this, and I'm reinventing Oroborous. It's not as easy as it first sounded.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found