Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Does there exist a CPAN module for lazily initialized variables?

by dragonchild (Archbishop)
on Jul 14, 2004 at 18:40 UTC ( [id://374387]=note: print w/replies, xml ) Need Help??


in reply to Does there exist a CPAN module for lazily initialized variables?

Ideally, the module used would be a dispatcher to the actual module needed, similar to how File::Spec dispatches to the right File::Spec::* module, depending on OS. So, you'd actually have Tie::Lazy and Tie::Hash::Lazy / Tie::Scalar::Lazy / etc. I think that would meet brian_d_foy's need for well-named distros ...

Is there a way of doing that kind of auto-detection?

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

  • Comment on Re: Does there exist a CPAN module for lazily initialized variables?

Replies are listed 'Best First'.
Re^2: Does there exist a CPAN module for lazily initialized variables?
by jryan (Vicar) on Jul 14, 2004 at 18:54 UTC

    The only way I can think of is to put all three sets of tie-methods in the same package, and let dispatch to the right ones automagically (with a bit of extra logic to deal with the common methods). I did this in Sub::Sealed, but that was a joke module, so I didn't really bother to find out if that was best-practice.

Log In?
Username:
Password:

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

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

    No recent polls found