Larry Wall wrote:
> So I was thinking it'd be better to use something different to
> represent the outer topic...

How about this:

   $_       # current topic
   $__      # outer topic
   $___     # outer outer topic

   ...etc...

I also wondered if $= might be a suitable alias to the current iterator.
It has a nice mnemonic, looking as it does like a '_' stacked on top 
of another.

   while <$something> {
       if ($=.first) {
           # first iteration
       }
       elsif ($=.last) {
           # last iteration
       }
   }

You could then use $==, $===, etc., to access outer iterators:

   while <$foo> {
       while <$bar> {
           if ($==.first) {
              # first foo
           }
           if ($=.first) {
              # first bar
           }
       }
   }


A

Reply via email to