Because subroutines are considered Statements and Statements use Semicolon between them, the following fails:
sub foo () {...}
sub bar () {...}
Instead, it has to be written this way:
sub foo () {...};
sub bar () {...};
This also affects if() conditions:
if ($foo) {1} # ok
if ($foo) {1} foo() # not ok
if ($foo) {1}; foo() # ok
if ($foo) {1} elsif ($bar) {2} foo(); # not ok
if ($foo) {1} elsif ($bar) {2}; foo(); # ok
[Edit: added all blocks.]
Because subroutines are considered Statements and Statements use Semicolon between them, the following fails:
Instead, it has to be written this way:
This also affects
if()
conditions: