go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think the most productive approach would be to post test code, assuring your intentions are understood, such that other stop posting speculative code...
Anyway I doubt that your desired "my_local" (or better named "lex-local") is what you need, since $x,$y,$z will always also belong to the outer scope, making ugly side-effects probable!
the following is simple and very close but lacks the same aliasing like $_[0] does. $lamb = sub { my ($x,$y,$z) = @_; $x + $y } so using Data::Alias or Lexical::Alias might be what you need to install for lexicals. If you don't wanna install XS-Moduls try working with lex-refs
NOTE: Aliasing can always be achieved with * and pack-vars.
Cheers Rolf In reply to Re^3: Local for lexicals
by LanX
|
|