"be consistent" | |
PerlMonks |
Re: A general method of locally overriding subroutinesby xdg (Monsignor) |
on Mar 11, 2006 at 05:37 UTC ( [id://535882]=note: print w/replies, xml ) | Need Help?? |
What worked for me in my experiments with localizing variables in Object::LocalVars is to build a string with all the local calls and then eval it. That would avoid the recursion. You could either include the function call and arguments in the eval directly or have the eval return just a single anonymous function that does all the localization and then the function call. As a side note, you can also use local in a list context like my, so you could try to build that eval string along these lines:
-xdg Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In Section
Meditations
|
|