Bryan asked:

   > > That would be:
   > >
   > >      given ( $a ) {
   > >              when /a/ : { foo($a); goto BAR }
   > >              when /b/ : { ... }
   > >         BAR: when /c/ : { ... }
   > >              ...
   > >      }
   > 
   > If they were statements, wouldn't that be:
   > 
   >          when /a/ : { foo($a); goto BAR };
   >          when /b/ : { ... };
   >     BAR: when /c/ : { ... };
   >          ...
   > 
   > That's why I was considering them blocks, which I, of course, mislabelled 
   > clauses.  Like if blocks and while blocks.

A C<when> is a statement, just as an C<if> or a C<while> is a statement.


   > > Using C<next BAR> would (presumably) cause control to head up-scope
   > > to the first *enclosing* block labelled 'BAR'.
   > 
   > But wasn't a bare 'next' supposed to continue on to the next statement?

Yes.


   > given ( expr ) {
   >     when /a/ : { foo; next }
   >     when /b/ : { bar }
   > }
   > 
   > If /a/ is true, do foo(), and then continue on to the next statement.

Yes.


   > If that was/is still the case, then wouldn't a 'next LABEL' imply
   > continuing on to the next statement labelled LABEL?

I guess that would be consistent too. Hmmmm.


   > Of course, if it is no longer 'next', then that's fine, too.

No. As far as I know, it's still C<next>. That's just an extension of
the C<when...next> semantics I hadn't considered. Thanks.

Damian

Reply via email to