On Mon, Sep 25, 2006 at 12:35:49PM +0100, David Cantrell wrote:
> On Thu, Sep 21, 2006 at 07:02:56PM -0400, Duane Bronson top-posted:
> > Ronald J Kimball wrote:
> > > What would you have Perl do in the case of nested loops?
> > $.. should be the iterator count in the parent loop, $... should be the 
> > iterator count in the grandparent loop, ...
> 
> Ick!  Better to use a stack, methinks, like I do for getting at outer
> map{}s' versions of $_ in NestedMap.

And even using a stack suffers from the flaw that any sort
of refactoring that puts a loop around a portion of the code
means search through the entire section and increasing the
index of any reference to a loop outside the new one, while
not increasing the index of any reference to a loop within
the new one.  That's a good source of subtle errors there.

-- 
 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to