Don't nest named subroutines. You'll just get problems.
Didn't you notice any "%s will not stay shared" warnings?
Didn't you notice any "subroutine %s redefined" warnings?
You've already noticed it isn't scoped as you expected.
I use
sub recursive { ... local *helper = sub { ... helper(...) if $cond; ... }; ... helper(...); ... }
In reply to Re: Scope of subroutines with same name
by ikegami
in thread Scope of subroutines with same name
by atemon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |