laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
As you haven't told us what problems you're trying to address it's hard to give you a good direction to investigate in. There is an experimental feature named lexical_subs that is supposed to declare lexically scoped subroutine names in the following form:
But as far as I know, the feature never left its experimental status and has the same interactions with lexical variables as the traditional approach using lexical variables has. If you want to use local subroutines without polluting the namespace, just use anonymous subroutines:
Using dynamic scope is usually fraught with problems as debugging dynamic scope is difficult. There is a reason why lexical scope was a great thing for Perl 5, and while it is sad that there is no convenient lexical scope for subroutines, working around this with dynamic scope is a bad idea. In reply to Re: how to declare a local *subname=sub{}?
by Corion
|
|