in reply to Syntax error in Nested for
In the line:
say for keys %$_ for @x;
the second for is being used as a statement modifier on another for loop, but statement modifiers are allowed only on “simple” statements (Statement Modifiers). But you can do this instead:
do { say for keys %$_ } for @x;
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Syntax error in Nested for
by NetWallah (Canon) on Jul 03, 2013 at 03:17 UTC |