in reply to Examing local's stack
Create your own stack without bothering with local()? It doesn't sound like it's doing what you want it to do, so, performance issues aside, why bother with it?
{ # start of block of variables private to function foo() my @stack; sub foo { my ($var) = shift; push(@stack, $x); $x=$var; # code involving foo() and $x goes here... $x=pop(@stack); } # end foo } # end block of variables private to function foo()
Just a thought...
--
Ytrew
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Examing local's stack
by adrianh (Chancellor) on Mar 22, 2006 at 09:53 UTC |