"Bryan C. Warnock" wrote:
> 
> No examples are given, but are we to assume that this:
> 
>     for ($x = 0; $x < 100; $x++) {
>         ...
>     }
> 
> becomes this:
> 
>     loop $x=0; $x < 100; $x++ {
>         ...
>     }

Yes.

 
> How would you use an $x lexically scoped to the loop block?

You can't...directly. Nor can a C<while> or C<if>. The new rule is that
to be lexical to a block it has to be declared in the block, or in the
block's parameter list.

You'd need to use another layer of braces:

        do {
      loop my $x=0; $x < 100; $x++ {
          ...
      }
        }

Damian

Reply via email to