This is the conventional use of the if
in perl. Notice that there is no need for curly braces ({
and }
). The body of the if
ends with the appropriate keyword, end
, else
or elsif
. The then
word is generally optional, though you need it if you want to put start the body on the same line as the if
, the way the last statement does.