этот код:
#!/usr/bin/perl -w
sub marine{
print "somestuff\n";
exit 1;
}
$bool=1;
if($bool)
marine();
дает ошибку:
Bareword found where operator expected at ./a line 10, near ")
marine"
(Missing operator before marine?)
syntax error at ./a line 10, near ")
marine"
Execution of ./a aborted due to compilation errors.
Однако он работает, когда в теле if есть {}
. Так нужны ли они в perl?