Conditional Logic in Ruby

Watch out! This tutorial is over 3 years old. Please keep this in mind as some code snippets provided may no longer work or need modification to work on current systems.
Tutorial Difficulty Level    

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, endelse 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.

As in most languages (excluding Python), indenting is not required, and is ignored by the interpreter. Of course, it is wise to indent in a way which reflects the structure of the code.