in reply to Scope of subroutines with same name
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(...); ... }
|
|---|