develooper Front page | perl.perl5.porters | Postings from June 2021

Re: RFC: Multiple-alias syntax for for

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
June 22, 2021 18:58
Subject:
Re: RFC: Multiple-alias syntax for for
Message ID:
2d63a505-3d90-45d9-a6b8-5c0e1c51c60b@beta.fastmail.com
On Tue, Jun 22, 2021, at 2:07 PM, David Nicol wrote:
> 
> Don't recall seeing this case discussed:
> 
>               my @iters = (undef,undef); # empty list would be run-time error!
>               for @iters ( @iterees) {
>                     ... #   $iters[0] is alias to even iterees, $iters[1] is alias to odd ones
>                     # if @iters changes size, next time through it gets that many
>              }

It's not legal.  The thing after "for" must be a parenthesized list of scalar targets.

-- 
rjbs
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About