Scalar::Defer does what you want.
Perfect! Many thanks. Think "defer" was one keyword I'd missed in all searching.
However, my advice is to reconsider and use a normal object instead. It will be much less confusing.
No doubt you're completely right but now I've started... ;) Actually, from glancing at Scalar::Defer and considering I want to do similar for arrays and hashes later, for which CPAN doesn't seem to have anything, that will probably be the end of it. The mission was to be able to replace a set of subroutines which execute queries immediately with "lazy" versions, simply be changing the module being used. Anyway - have learnt something.
BTW - you're not Perrin as in Perrin Harkins as in Krang are you? If so, we met at OSCOM.4 in Zurich a couple of years ago - was doing that talk on stuff like wrapping output from pod2html in PHP. Been meaning to drop you a "Hello" for a long time. Is this the right email - http://search.cpan.org/~perrin/
|