Perl: the Markov chain saw | |
PerlMonks |
Re: why does Perl eval have a strange terminator?by ikegami (Patriarch) |
on Jun 14, 2022 at 16:32 UTC ( [id://11144732]=note: print w/replies, xml ) | Need Help?? |
«if», «else» and «while» are keywords part of "if" statements and "while" statements. Flow control statements don't take semicolons.
The «if» and «while» keywords are also found in statement modifiers. Statements with statement modifiers do take a semicolon.[1]
eval and map are "functions" (named operators). Function calls do no take semicolons. But they may be found in statements which do use a semicolon.
This includes simple statements.[1] These are statements that consist of nothing but an expression.
The statement you gave is an example of a simple statement, and so is the «or»-using statement above. C, C++, C#, JavaScript and Java all work this way.
Updated to elaborate.
In Section
Seekers of Perl Wisdom
|
|