Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Syntax error in Nested for

by Athanasius (Archbishop)
on Jul 03, 2013 at 03:07 UTC ( [id://1042139]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1042139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found