in reply to Re^3: Local for lexicals
in thread Local for lexicals
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 ….)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Local for lexicals
by BrowserUk (Patriarch) on Aug 11, 2009 at 04:39 UTC | |
by JadeNB (Chaplain) on Aug 12, 2009 at 19:17 UTC | |
|
Re^5: Local for lexicals
by LanX (Saint) on Aug 11, 2009 at 13:18 UTC | |
by JavaFan (Canon) on Aug 11, 2009 at 13:39 UTC | |
|
Re^5: Local for lexicals
by JavaFan (Canon) on Aug 11, 2009 at 10:06 UTC |