talking about nested subs brought up another related idea, static (not
on the stack) lexicals inside subs. the current solution in p5 is to
declare them in a surrounding block and that is slightly ugly. and if
you want multiple subs to share them they all have to be in that block.

so a simple is static trait on those variables would allow them to be
declared inside the sub itself. an = or is default would work only the
first time the sub is called or at compile time.

and any subs that would want to share those vars could be nested inside
the same parent sub.

the p5 way should still work if you need the multiple subs to be all
visible (in whatever scope).

maybe i missed this one in apoc6 too. my brane is hurting too much to
do a proper search. :)

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class

Reply via email to