Part 3 in our continuing series on the popular scripting language, Perl. This week's article teaches you more about Perl's controlstructures - including the FOR and WHILE loops - and also introduces you toPerl's array variables.
Last time, we introduced you to Perl's basic control structure - the"if-else" family of conditional statements - and also taught you a littlemore about scalar variables. This week, we're going to proceed a littlefurther down that same road, with a look at the different types of loopsyou can use in Perl, an introduction to a new type of variable, and atongue-in-cheek look at the things modern managers do in the interests of afatter bottom line.
As always, we'll begin with a definition for those of you coming at thisseries from a non-programming background. In geek-talk, a "loop" isprecisely what you would think - a programming construct that allows you toexecute a set of statements over and over again, until a pre-definedcondition is met.
Every programming language worth its salt uses loops - and, incidentally,so do quite a few shampoo manufacturers. Think lather-rinse-repeat, andyou'll see what we mean...