in reply to foreach over empty list
The first set of parens are a required part of the for/foreach syntax, not an empty list. Put an empty list inside them and all is well:
c:\test\xx>perl -we"for () { print; }" syntax error at -e line 1, near "() " Execution of -e aborted due to compilation errors. c:\test\xx>perl -we"for (()) { print; }"
|
|---|