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; }"
In reply to Re: foreach over empty list
by BrowserUk
in thread foreach over empty list
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |