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


in reply to Refactoring: sub within a sub

Hm, okay that makes sense. I will probably be fine implementing it like this then. Just wanted to know if there were any major pitfalls or get some insight into an alternative implementation.

Strange things are afoot at the Circle-K.

Replies are listed 'Best First'.
Re^2: Refactoring: sub within a sub (-w)
by tye (Sage) on Jul 25, 2012 at 22:46 UTC

    The major pitfall is that, if you ever call the outer sub more than once per process, then the inner sub will not be sharing any lexicals defined within the outer sub, hence the "won't stay shared" warning. So be sure to enable warnings.

    - tye