in reply to How do I localize a value to the calling function's scope?
You can do that with local:
You have that in your list, but it's no more typing than your function call, and it does what you want. Wherever foo calls bar, the stub is called.sub test_foo { no warnings 'redefine'; local *Module::bar = \&stub_for_bar; # test code for Module::foo goes here }
Lexical warnings.pm saves a lot of trouble.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I localize a value to the calling function's scope?
by Ytrew (Pilgrim) on Oct 15, 2004 at 18:29 UTC |