Well House
Consultants
Training, Open Source Computer Languages

This is page http://www.wellho.net/resources/P206.html

Our email: info@wellho.net • Phone: +44 (0)1225 708225

Perl module P206
More Loops and Conditionals
Exercises, examples and other material relating to training module P206. This topic is presented on public courses Perl Programming, Perl bootcamp

Learning to program in Perl / Perl Programming - Programming Perl - for newcomers to the language This course introduces you to the Perl programming language. ...
http://www.wellho.net/course/ppfull.html  [course]
Learning to Program in Perl / Perl Programming - Learning Perl - whether you're new to programming or 'converting'. This course covers programming in the ...
http://www.wellho.net/course/lpfull.html  [course]
When you're in a loop there are occasions you want to say get me our of this loop NOW, or "I'm done with the current iteration. And those are the 'classic' ...
http://www.wellho.net/mouth/962_Brea ... uages.html  [short article]
The ? and : operator in Perl and PHP allows you to write a single statement that's both an if and an else without the need for all the clutter of keywords, ...
http://www.wellho.net/mouth/1825_Que ... -PHP-.html  [short article]
Perl Bootcamp - The fundamentals of the language. This course covers the fundamentals of the Perl programming for computer professionals who are new to ...
http://www.wellho.net/course/bpfull.html  [course]
The ? : operator that you may have come across in Perl, PHP, C and Java - known as the ternary or conditional operator - is ABSENT from Python. "But it's ...
http://www.wellho.net/mouth/657_The- ... ython.html  [short article]
When writing a program, you'll often want to repeat a block of code, counting up through a table or performing a block of code with an input value (loop ...
http://www.wellho.net/mouth/1220_for ... -etc-.html  [short article]

"There's more than one way of doing it," says the cover of Programming Perl, the book co-written by Larry Wall, who wrote the language. He's right Ð there are usually many ways of doing the same thing. That's confusing for the newcomer, but great for the experienced practitioner. This module covers extra syntaxes for "if" and "while", and other loops and conditionals that use different keywords, or no keywords at all.

This topic is presented on public courses Perl Programming, Perl bootcamp

Tips and short articles on this subject
Are you learning Perl? Some more examples for you!
A pint of Black Rat, and a lazy barman
Setting a safety net or fallback value in Perl
switch and case, or given and when in Perl
For loop - checked once, or evety time? Ruby v Perl comparison and contrast
Question Mark - Colon operator (Perl and PHP)
Saying NOT in Perl, PHP, Python, Lua ...
Ruby, C, Java and more - getting out of loops
for loop - how it works (Perl, PHP, Java, C, etc)
Smart English Output - via PHP and Perl ? : operator
Breaking a loop - Ruby and other languages
The ternary operator in Python
What - no switch or case statement?
Perl - redo and last without a loop
Examples from our training material
andor   and, or, &&, || - precendence
bip   Different conditionals and comparisons
dice   Sample answer - rolling a die
dowhile   a while loop that runs at least once
dunt   A do ... until loop - reprompt until you get valid input.
forloop   Good and bad examples of a for loop
given_demo   given (Perl 5.10 onwards)
golf   Knockout competition - how many teams / players needed?
jump2   Using a label in Perl to jump out of nested loops
jumps   demonstration of next, last and redo
jumps2   Using a label in Perl to jump out of nested loops
lazyops   Lazy and and && operators
mls   Knock out Competition - how many teams?
power   inverted until loop example
qc   while loop, rewritten as for loop
qc2   use of triadic operator
safety_net   The // defined or operator
swit   Use of label to mimic a switch
tae   Checking user input
tel2   unless, and if and unless written in reverse
tel3   Conditional operators "and" and "or"
tel4   Usin the ? : operator instead of if and else
telegram   if and else example
throwz   Sample answer - throwing a die
Pictures
We project live demonstrations to help you learn
Customers range from one-man-bands to multinationals
Background information
This module is available under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
The variety that is Perl.
More conditional statements.
If -- single statement rather than a block.
Unless -- an inverted if statement.
Conditional operators.
The ? : operator.
More loop statements.
The until loop.
Single statement while and until loops.
The for loop.
The do - while loop.
Breaking a loop.
Labels.
The goto statement.
Summary.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


© WELL HOUSE CONSULTANTS LTD., 2010: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: +44 (0)1225 708225 • FAX: +44 (0)1225 344596 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho