It's not the dynamic-scoping-like behaviour that's the problemYes, it is:
The real difficulty (for me, anyway) is making a change in an inner scope to a lexical variable in an outer scope in such a way that the change will ‘revert’ outside that scope.That's the dynamic scoping you're after.
Make $x a package variable, use local, and it will work the way you want. I don't see the point of making $x a lexical if you don't want lexical behaviour.
In reply to Re^3: Local for lexicals
by JavaFan
in thread Local for lexicals
by JadeNB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |