Speaking of subs, and especially recursive ones which have been mentioned
en passant earlier, I have another question "of mine": I know that in the
vast majority of cases this won't be useful in any way, but in the body of
a (possibly anonymous) sub/block, will there be some sort of identifier to 
refer to itself? I mean, in such a way to be able create anonymous 
recursive functions. In Perl5 it's doable by means of some trickery that 
involves an assignment, anyway.

Thinking of it better lexicals will be in package MY, right, so a possibly 
not too out of question choice may be MY::_self (with underscore to avoid 
unwanted collisions with user stuff). Something like (hopefully):

  print sub -> $n { 
      # Admittedly stupid example!
      return $n if $n<=1;
      MY::_self($n-1) + MY::_self($n-2);
  }.(10);


Michele
-- 
> I do have backups, just not recent ones.
I think my wife is now pregnant.
She has a supply of birth control pills and she does use them,
just not recently.   ;)
- Jim Lisson in alt.windows98, slightly edited

Reply via email to