Multiple choice technology programming languages

Which of the following is used in perl?

  1. else if

  2. elseif

  3. elsif

  4. elif

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Perl uses 'elsif' for conditional chains (note the missing 'e'). This differs from C-style 'else if' and shell-style 'elif'. Option C shows the correct Perl syntax. This is a common point of confusion for programmers coming from other languages.