Don't write a named subroutine within another named subroutine. It doesn't work at all well.
In reply to named subs within named subs by perl5ever