Keep It Simple, Stupid | |
PerlMonks |
Re: Passing a variable recursivelyby marinersk (Priest) |
on Nov 06, 2012 at 07:36 UTC ( [id://1002424]=note: print w/replies, xml ) | Need Help?? |
OO noob here, so I'm just asking without having tested this yet, but --
Wouldn't another approach be to pass the logger object to the module if you wish it to use that logger object instance? something like:
You achieve the intended result, which is a lot like Global State, but not with a Global State implementation. You tell the subordinate method which logger to use, and its logging behavior is driven by its previously-established logging level attribute. Or am I out in left field here, and worse, the game is soccer?
In Section
Seekers of Perl Wisdom
|
|