This is, in a sense, the crux of my problem—I don't want the values of $x, $y, and $z to leak from the inside out, or vice versa, even though they have meaning in the outer scope. In this case, there are many ways around it, which you and others have indicated, but I was just wondering if there was any reason that one had to work around it, or if there were a lex_local that could just be dropped in for lexicals as local can for globals.{ #outer scope $lamb = lambda ( $x, $y, $z ) => sub { $x + $y } }
NOTE: Aliasing can always be achieved with * and pack-vars.I know about *, although it doesn't seem to do much for lexicals, but what do you mean by pack-vars?
I think the most productive approach would be to post test code, assuring your intentions are understood, such that other stop posting speculative code...(I PM'd you about this, but, on further thought, it seems that there's no reason to keep it P. :-) ) I agree, since it seems pretty clear that I'm not doing a good job of indicating the problem that I'm trying to solve. However, I don't know how to improve. Do you have any suggestions? (This seems almost worthy of being a post in its own right ….)
In reply to Re^4: Local for lexicals
by JadeNB
in thread Local for lexicals
by JadeNB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |