Do you know where your variables are? | |
PerlMonks |
Re: Pre-caching large constantsby chromatic (Archbishop) |
on Feb 08, 2002 at 21:26 UTC ( [id://144240]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|