Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Control statements and looping

by root (Scribe)
on Nov 03, 1999 at 02:58 UTC ( #918=perltutorial: print w/replies, xml ) Need Help??

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
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Node Status?
    node history
    Node Type: perltutorial [id://918]
    help
    Chatterbox?
    [Corion]: Hehe - $work is a place where we have lots of (money) accounts, and lots of journals where every transaction is recorded. But our HR system where the accounts of hours worked and vacation days taken are stored, there is no real account of who changed ...
    [Corion]: ... that balance, and when. And it seems to me that they somehow really messed up the database since the start of the year and have been frantically adding and subtracting numbers from the totals, but without trace ;)

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (7)
    As of 2018-01-23 16:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      How did you see in the new year?










      Results (249 votes). Check out past polls.

      Notices?