Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I can see the argument against using Singletons just as global variables. But in many circumstances they are useful. The most obvious two situations I use them are in:
Passing a database handle to all methods, or to multiple objects gets sloppy fast - but having a single resource to fetch it from is neat. Similarly with debug files; although they are sometimes abused when you realise you need more than one logfile... In reply to Re^2: Things I Don't Use in Perl
by skx
|
|