Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^4: sub scope questionby papidave (Pilgrim) |
on Feb 07, 2008 at 17:36 UTC ( [id://666825]=note: print w/replies, xml ) | Need Help?? |
ikegami, Thank you for the comments on my implementation details; I have improved my wording above. As regards the remainder of your response, I think we both agree that nesting named functions has no benefit in Perl; we differ only in how to resolve it. By going with an unnamed function assigned to a local var, you eliminate the "named" part; by moving $list_ref outside the function, you can then also move the named function to main scope, thereby eliminating the "nesting". In either case, I favor passing arguments into a subroutine over retention of state information in a closure or any kind of shared variable, because I find it easier to maintain -- but then, TMTOWTDI.
In Section
Seekers of Perl Wisdom
|
|