Perl offers an abundance of looping and control statements. Some quick notes if you're a C, C++, or Java programmer Perl requires curly braces around blocks of code even if your for loop has only one line of code. Secondly, if you're new to programming these control statements test whether a statement is true of false and then control execution of the program based on the results. You might want to look at what is true and false in Perl?

Or you can dive right into the control statements

  • if statements
  • unless statements
  • while loops
  • until loops
  • do while loops
  • do until loops
  • for loops
  • foreach loops
  • Comment on Control statements and looping