Why are anonymous subs more acceptable?
Since subs are package-scoped in Perl 5, the inner subs are visible from the outside. Which means that they are visible before the outer sub is run, which is why they can't easily be a closure over the variables from the outer sub.
Which is why anonymous subroutines are safer in this case.
In reply to Re: Refactoring: sub within a sub
by moritz
in thread Refactoring: sub within a sub
by temporal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |