|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: Logging Singletonby 7stud (Deacon) |
| on Feb 18, 2013 at 17:26 UTC ( #1019377=note: print w/ replies, xml ) | Need Help?? |
|
Please let me know if there is a better way or a perferred method.
With a closure, you can't (mistakenly) change the $logger singleton in another subroutine:
The my variable $logger ceases to exist after the end of the block, and thereafter only the sub get_logger() can see the $logger variable.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||