Graham Barr once allowed as how he thought it would be neat if you could say
for my($x, $y, $z) (@list) { ... }
i.e., more than one loop variable, assigned successively from the list. He
didn't have time to RFC it, but when I looked at it, a problem arose: if
the loop variables aren't declared lexical right there, how can the parser
tell in a case like
for ($a, $b, $c) (@list) { ... }
that it means multiple loop variables, and not
for $_ ($, $b, $c) etc
IANAPE (I Am Not A Parsing Expert). So I thought I would see if anyone who
was could say whether this construct would really give the parser problems
or whether looking ahead for the block will disambiguate.
Unfortunate that (I assume that) it couldn't extend to the modifier form as
well.
--
Peter Scott
Pacific Systems Design Technologies