in reply to Passing a variable recursively
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:
# calling program stuff my $loggerHandle = new myLogger(); my $workerHandle = new myWorker(); my $returnValue = $workerHandle($loggerHandle, $Parameter, $Option, $E +tc);
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing a variable recursively
by tobyink (Canon) on Nov 06, 2012 at 09:30 UTC |