Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re (tilly) 2: OO vs. global variables...

by tilly (Archbishop)
on Sep 05, 2001 at 20:38 UTC ( #110345=note: print w/replies, xml ) Need Help??


in reply to Re: OO vs. global variables...
in thread OO vs. global variables...

But note that there are good reasons to use singletons in Perl. The most common one for me is when the object is expensive to create (database connections etc) and might need to exist for many reasons, but might be possible to do without. In that case then you just use a singleton and issue calls to its constructor from wherever you need it.

Now no matter how complex the logic is to need it, it is there when you want, and you don't pay for it when you don't need it.

  • Comment on Re (tilly) 2: OO vs. global variables...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2022-01-16 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (49 votes). Check out past polls.

    Notices?