It's static and lexical to two subroutines.
And yes, localizing a var is a trick. Something that confuses most newcomers to Perl. Localizing a whole typeglob so that you could call the newly created closure as if it was an ordinary subroutine doubly so. If you insist on using local(), localize the $move_disk and define the _hanoi() as an ordinary subroutine accessing the package variable $move_disk.
BTW, what was the last time you actually generated a stack trace?
Jenda
Enoch was right!
Enjoy the last years of Rome.
In reply to Re^6: passing subroutine references
by Jenda
in thread passing subroutine references
by joe76
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |