Daniel Brockman wrote:
What about this?

   given @foo {
     for $_ -> $x { ... }
     when .empty { ... }
   }

You can reverse the order if you want:

   given @foo {
     when .empty { ... }
     for $_ -> $x { ... }
   }

Actually, you'd be better off using the second order; the "when"
statement would drop you out of the "given" block if triggered, and
you'd never get to the loop.  In the first order, you'd be triggering
both the loop and the "when" every time the "given" block executes.

--
Jonathan "Dataweaver" Lang

Reply via email to