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.