rovf has asked for the wisdom of the Perl Monks concerning the following question:
I had the following piece of code
I was supposed that this would act as a no-op - looping over an empty list and doing nothing - and was only meant as a placeholder where I wanted to put in the "real meat" later. To my surprise, this didn't compile: syntax error ... near "()"foreach () {}
Why does it reject my empty list? I re-read perlsyn, but didn't find anything which would forbid such a construct.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: foreach over empty list
by BrowserUk (Patriarch) on Jun 06, 2011 at 14:51 UTC |