in reply to Hard syntax error or disambiguable parsing?

See excerpts from perly.y:

label FOR MY remember my_scalar '(' mexpr ')' mblock cont label FOR scalar '(' remember mexpr ')' mblock cont label FOR '(' remember mexpr ')' mblock cont label FOR '(' remember mnexpr ';' texpr ';' mintro mnexpr ')' my_scalar: scalar scalar : '$' indirob indirob : WORD | scalar %prec PREC_LOW | block | PRIVATEREF

PRIVATEREF is defined in toke.c and seems of no help here. So the only hope is: '$' block.

for ${\$i[0]} ( 1..10 ) { print @i, $/ } __END__ Not a GLOB reference at ...

So give it a GLOB reference:

for ${*X=\$i[0];*X} ( 1..3 ) { print "$X(@i)$/" } 1() 2() 3()

Which runs but still doesn't do what you want.

Update: And the "Not a GLOB reference" is probably indicative of what merlyn noted: foreach needs to know the name of the scalar variable to create for use inside of the loop (which often obscures an existing lexical or package variable of the same name either via 'my' or 'local', as documented).

- tye