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
    Ah ! - Thanks - I see it as the very first statement in the docs:
    Any simple statement may optionally be followed by a SINGLE modifier,. +..

                 My goal ... to kill off the slow brain cells that are holding me back from synergizing my knowledge of vertically integrated mobile platforms in local cloud-based content management system datafication.