http://www.perlmonks.org?node_id=983725


in reply to Refactoring: sub within a sub

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.